I'm stumped on a problem with horizontal stretching, and I don't know
whether I've hit a bug or my own ignorance. I want to place two sliders
horizontally and have them both stretch with the frame. Instead, the left
one stretches, and the right one doesn't. (I'm not sure I have "stretch"
and "expand" clear in my mind. The right slider gets more space but doesn't
fill it up.) One example of this behavior is at
http://conal.net/phooey/images/ui3.png. I've also included below a simple,
self-contained example. I'd like to get this behavior fixed in two
wxhaskell-powered libraries I'm about to release.
I'm using "row" to get the horizontal juxtaposition, and hfill.widget for
the slider layouts. I'd sure appreciate help from someone who knows about
Thanks, - Conal
main = runWio ssBeside
type Wio = Panel () -> IO Layout
-- Simple slider
sslider :: Wio
sslider w = do ctl <- hslider w True 0 10 
return (hfill (widget ctl))
ssBeside :: Wio
ssBeside w = do la <- sslider w
lb <- sslider w
return (row 0 [la,lb])
-- "Run" a 'Wio': handle frame & widget creation, and apply layout.
runWio :: Wio -> IO ()
runWio wio = start $
do f <- frame [visible := False]
pan <- panel f 
l <- wio pan
set pan [ layout := l ]
set f [ layout := hfill (widget pan), visible := True ]
On Tue, Jan 16, 2007 at 00:22:16 -0800, Conal Elliott wrote:
> I'm stumped on a problem with horizontal stretching, and I don't know
> whether I've hit a bug or my own ignorance. I want to place two sliders
> horizontally and have them both stretch with the frame. Instead, the left
> one stretches, and the right one doesn't.
I ran your code both under MacOS X and Linux, and they both seem to
expand the sliders symetrically. Maybe this is a Windows-specific
issue? Could somebody else try the code?
Eric Kow http://www.loria.fr/~kow
PGP Key ID: 08AC04F9 Merci de corriger mon fran=E7ais.