I'm using wxhaskell 0.10.3 with ghc 6.8.2 on Windows XP Pro.  I'm 
trying to figure out how to change the content of a frame 
dynamically.  The program shown below has several problems:
   * The initial text is garbled (a combination of "Screen 1" and "Screen 2").
   * The button label doesn't change when first clicked.
   * Nothing changes on subsequent button presses.
Any ideas?

>  module Main where
>
>  import Graphics.UI.WX
>
>  main = start gui
>
>  gui = do
>    f    <- frame [text := "Test 1"]
>    p    <- panel f []
>    t1   <- staticText p [text := "Screen 1"]
>    b1   <- button p [text := "switch to 2"]
>    t2   <- staticText p [text := "Screen 2"]
>    b2   <- button p [text := "switch to 1"]
>    set b1 [on command := switch f p t2 b2]
>    set b2 [on command := switch f p t1 b1]
>    switch f p t1 b1
>
>  switch f p t b = set f [layout := fill $ container p $ margin 10 $ 
>column 5 [widget t, widget b]]

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users

Reply via email to