Reshaping a window along with it's subwindows
Hi i am a novice and using opengl with glut..
smne plz tell me how can i reshape a window along with its subwindows...so that each dispay on the scrren (including those visible in the subwindows) are changed proportionatly....
Unfortunately this is something you need to do yourself (unless you use some advanced GUI framework). The advanced GUI frameworks usually let you pin the sides of the window to the borders. What you want to do sounds like proportionally size the controls.
It boils down to:
1)
On startup remember all the control positions and sizes
2)
On the size event (WM_SIZE), glut probably offers a callback use the given new size to calculate the new positions and sizes. You might want to use BeginDeferWindowPos and EndDeferWindowPos around SetWindowPos if the number of controls is not a small number to keep flickering down.
Use the remembered sizes for the calculation, otherwise rounding errors will creep in.
It boils down to:
1)
On startup remember all the control positions and sizes
2)
On the size event (WM_SIZE), glut probably offers a callback use the given new size to calculate the new positions and sizes. You might want to use BeginDeferWindowPos and EndDeferWindowPos around SetWindowPos if the number of controls is not a small number to keep flickering down.
Use the remembered sizes for the calculation, otherwise rounding errors will creep in.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement