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
wxHaskell layout.

Thanks, - Conal

--------

import Graphics.UI.WX

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 ]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to