L.Guo | 7 May 2009 12:06
Picon

3 Layout quiz

Hi MailList wxHaskell user:

    I am new to wxhaskell.
    In reading examples and writing my test program, I need some help about Layout controls.

    Reading wxhaskell/samples/wx/Layout.hs, here is the code piece.

>  set f [defaultButton := ok
>        ,layout := container p $
>                   margin 10 $
>                   column 5 [boxed "coordinates" (grid 5 5 [[label "x:", hfill $ widget xinput]
>                                                           ,[label "y:", hfill $ widget yinput]])
>                            ,floatBottomRight $ row 5 [widget ok,widget can]]
>        ]

    I donot know why there must be an container p out of the layout of the controls. I
have tried remove the container, after that, the text boxes and buttons dispeared. Why ?

    In my test, I have written a piece of code like this.

>  set f [layout := column 2 [hfill $ row 1 [hfill $ label "Left"
>                                           ,vfill $ vrule 2
>                                           ,hfill $ label "Right"]
>                            ,hfill $ hrule 1
>                            ,floatCenter . margin 1 . grid 5 5 $
>                               map (\i -> map (label . show) [i..(i+5)]) [1..5]
>                            ]
>        ...

    In the above code, the frame f has a status bar. I have two questions about it.
(Continue reading)


Gmane