Trouble with layout in wxHaskell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble with layout in wxHaskell

Nathan Hüsken
Hey,

I am trying to understand how do a layout in wxHaskell. I am trying to
make a frame with 2 text entries. One single lined at the top and one
multiline below it. Both should expand with the window size horizontal.
When the window is expanded vertical, only the multiline text entry
should expand.

Her is what I wrote:

   main = start mainFrame

   mainFrame = do
     f        <- frame [text := "BiVision"]
     buffer   <- textEntry f []
     mainArea <- textCtrl  f []
     set f [layout := expand $ column 2 [hstretch $ widget buffer,
stretch $ widget mainArea]]

This gives me a window with the desired controls. But they are not
expanding.
Why?
I tried different combinations of expand and stretch (I do not really
understand the difference?). But nothing works.

I am guessing there is something simple I do not yet understand :).

Thanks for any help!
Nathan



Reply | Threaded
Open this post in threaded view
|

Trouble with layout in wxHaskell

Nathan Hüsken
Ok, I need to use fill und hfill.
I personally think the documentation is little confusing, but I will
take this to the developers.

Regards,
Nathan

On 08/14/2013 05:03 PM, Nathan H?sken wrote:

> Hey,
>
> I am trying to understand how do a layout in wxHaskell. I am trying to
> make a frame with 2 text entries. One single lined at the top and one
> multiline below it. Both should expand with the window size
> horizontal. When the window is expanded vertical, only the multiline
> text entry should expand.
>
> Her is what I wrote:
>
>   main = start mainFrame
>
>   mainFrame = do
>     f        <- frame [text := "BiVision"]
>     buffer   <- textEntry f []
>     mainArea <- textCtrl  f []
>     set f [layout := expand $ column 2 [hstretch $ widget buffer,
> stretch $ widget mainArea]]
>
> This gives me a window with the desired controls. But they are not
> expanding.
> Why?
> I tried different combinations of expand and stretch (I do not really
> understand the difference?). But nothing works.
>
> I am guessing there is something simple I do not yet understand :).
>
> Thanks for any help!
> Nathan
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners