From: Jeff H. <jef...@gm...> - 2009-07-14 18:08:57
|
incidentally, putting the GLArea in a window built from libglade seems to work so I know it's possible, but I don't want to depend on libglade for a single widget. On Tue, Jul 14, 2009 at 2:07 PM, Jeff Heard<jef...@gm...> wrote: > Nope... that's not the problem. I added a widgetSetSizeRequest in > the area's onConfigure event and no matter what size I make it, a > GL.get GL.viewport always returns the same thing... > > On Tue, Jul 14, 2009 at 11:20 AM, Axel Simon<Axe...@en...> wrote: >> >> On Jul 14, 2009, at 16:46, Jeff Heard wrote: >> >>> 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? >> >> I'm no expert on the GL widget, but if this widget needs to be informed >> about the size change of the window then you need to connect to the >> configure event which is emitted every time the window changes it's size. >> >> Axel. >> >> > |