|
From: David R. <dr...@jd...> - 2003-12-01 14:10:04
|
On Mon, Dec 01, 2003 at 01:49:16PM +0100, Daan Leijen wrote:
> >Is there some trick I need to know in order to get a scrolledWindow with
> >scrollbars?
>
> Use "virtualSize" to set the scrolling area. Use "scrollRate" to set the
> speed of the scrollbars.
In the example program below, I can't resize the window smaller than the
size required to fit all the labels, and thus no scrollbars show up. Is
there any way to use layout to arrange widgets in a scrolled window and
still get scrollbars? Or is there some other method that I should be using
to arrange the widgets in a scrolled window? I've basically just been
trying random permutations, but haven't been able to guess how to get
scrollbars.
import Graphics.UI.WX
main = start test
test = do
f <- frame [text := "Testing wxHaskell"]
quit <- button f [text := "Cancel", on command := close f]
scrolled <- scrolledWindow f [virtualSize := size 500 500,
scrollRate := size 20 20]
set scrolled [layout := margin 5 $ column 5 labels]
set f [layout := column 0 [fill $ widget scrolled,
margin 5 $ row 5 [hglue, widget quit, hspace 20]],
clientSize := size 100 100 -- this doesn't seem to have any effect at all.
]
return ()
labels = l 30 where l 0 = []
l n = label ("Label "++show n) : l (n-1)
--
David Roundy
http://www.abridgegame.org
|