Problem resizing widget contained in window

I created a window, like so: Gtk.windowSetTitle win name Gtk.widgetSetName win "Hieroglyph" Gtk.onDestroy win (exitWith ExitSuccess) Gtk.windowSetDefaultSize win w h Gtk.containerResizeChildren win And an GLDrawingArea like so: config ← Gtk.glConfigNew [Gtk.GLModeRGBA, Gtk.GLModeMultiSample, Gtk.GLModeDouble, Gtk.GLModeDepth, Gtk.GLModeAlpha] area ← Gtk.glDrawingAreaNew config Gtk.onRealize area ◊ GL.drawBuffer $= GL.BackBuffers Gtk.onExpose area (λ_ → renderOnExpose bus ≫ return True) and finally show it like this: Gtk.containerAdd win area Gtk.widgetShowAll win Now, if someone resizes the window, the GLArea does not appear to resize along with it. Did I screw something up? -- Jeff

On Tue, Jul 14, 2009 at 5:46 PM, Jeff Heard
Now, if someone resizes the window, the GLArea does not appear to resize along with it. Did I screw something up?
You need to call the opengl glViewport function(I don't remember what the haskell binding is called) in your resize handler so that opengl knows about the new viewport size. And you are also probably going to want to update the opengl projection matrix to prevent distortion as a result of a changed aspect ratio.
participants (2)
-
Bit Connor
-
Jeff Heard