[Fxruby-users] AW: scrollwin confusion
Status: Inactive
Brought to you by:
lyle
From: Recheis M. <Mei...@av...> - 2003-09-19 20:01:11
|
| Bil [mailto:bi...@vi...] wrote: |=20 | >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. | >[...] |=20 | 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 |=20 | # 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 | } |=20 | canvasFrame =3D FXHorizontalFrame @scrollWindow |=20 | canvas =3D FXCanvas.new canvasFrame, messageTarget, 0, | LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, | 0, 0, 5000, 5000 | ------------------- |=20 | I know my version works OK, so if this 'cut and paste' code doesn't = then hassle me again. |=20 | -- Bil Bas =20 thanks,=20 the solution looks fairly simple, if you look at it afterwards, but there are many holes to fall into on the way there ;) regards,=20 - Henon |