Hi Dean,

I'm very sorry nobody got back to you.  Personally, I filed your message
away in my pending queue and marked it 'reread'.

By the way, it might help to attach your examples in an easy
compile-and-run format, as I have hopefully done.  It just smooths
out these discussions a little bit! :-)

On Thu, May 15, 2008 at 01:10:58 -0400, Dean Herington wrote:
> I reread Daan's original paper and found a hint that layouts need to 
> mention each widget exactly once (though I can't find anything 
> definitive in documentation for either wxhaskell or wxwidgets). 
> Obeying that "rule" avoids the garbling, but I'm still not able 
> successfully to change the layout repeatedly.

Could you attach your modified code?  My experience with wxhaskell is
that once you create a widget, it's going to be displayed, so you might
as well lay it out somewhere.

> Even if I could, how 
> then would I show different subsets of widgets at different times?

You could set the visible attribute.
See attachment.

I do not claim that this is the right way to go about things.  Maybe
somebody like Mads or Shelarcy would have a better idea.

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
import Graphics.UI.WX

main = start gui

gui = do
   f    <- frame [text := "Test 1"]
   p1   <- panel f []
   t1   <- staticText p1 [text := "Screen 1"]
   b1   <- button p1 [text := "switch to 2"]
   p2   <- panel f []
   t2   <- staticText p2 [text := "Screen 2"]
   b2   <- button p2 [text := "switch to 1"]
   let l1 = [ container p1 $ margin 10 $ column 5 [widget t1, widget b1] ]
       l2 = [ container p2 $ margin 10 $ column 5 [widget t2, widget b2] ]
   set b1 [on command := switch f l2 p2 p1 ]
   set b2 [on command := switch f l1 p1 p2 ]
   switch f l1 p1 p2
 where
  switch f l on off = do set on  [ visible := True ]
                         set off [ visible := False ]
                         set f [layout := fill $ column 5 l]

Attachment: pgp2a5IYQcRuD.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to