[Fxruby-users] Re: scrollwin confusion
Status: Inactive
Brought to you by:
lyle
From: Bil <bi...@vi...> - 2003-09-19 20:24:21
|
>Recheis Meinrad wrote: > > what i want is simply a glcanvas that has a fixed size. when bigger than the holding window then i want scrollbars to appear. >[...] You are in luck, I have only recently wrestled with the same problem with= scrolling an FXCanvas (not an FXGLCanvas - should be the same, though).= This is how I finally got it to work, after many gruelling trials. Hope it= is helpful. Not sure if it is the *correct* way though... -------------------- @scrollWindow =3D FXScrollWindow.new aFrame, 0, LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT # Make it fill up the space in its frame each time we resize. @scrollWindow.connect(SEL_CONFIGURE) { frameThickness =3D 2 # Otherwise scrollbars cover frame. @scrollWindow.resize @scrollWindow.parent.width - frameThickness, @scrollWindow.parent.height - frameThickness } canvasFrame =3D FXHorizontalFrame @scrollWindow canvas =3D FXCanvas.new canvasFrame, messageTarget, 0, LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, 0, 0, 5000, 5000 ------------------- I know my version works OK, so if this 'cut and paste' code doesn't then= hassle me again. -- Bil Bas |