Difference between revisions of "WxHaskell/Layout"
BrettGiles (talk | contribs) m (Add link back to wxHaskell page) |
BrettGiles (talk | contribs) m (Changing secion heading levels) |
||
Line 1: | Line 1: | ||
− | = Layout = |
+ | == Layout == |
All details are based on using [[wxHaskell]] on Microsoft Windows XP. |
All details are based on using [[wxHaskell]] on Microsoft Windows XP. |
||
− | == Layout setting by Gridding == |
+ | === Layout setting by Gridding === |
In general, we can create layout by setting the layout argument in a frame or a panel, for example, |
In general, we can create layout by setting the layout argument in a frame or a panel, for example, |
||
Line 17: | Line 17: | ||
'''Gridding''' means using the layout function, such as grid, row, column etc, to set the layout. |
'''Gridding''' means using the layout function, such as grid, row, column etc, to set the layout. |
||
− | == Layout setting by Positioning == |
+ | === Layout setting by Positioning === |
Also, we could set the layout by another way, '''Layout setting by Positioning''' |
Also, we could set the layout by another way, '''Layout setting by Positioning''' |
||
Line 30: | Line 30: | ||
The result of both examples are about the same, only the button position has a bit different. (Please measure the exact position by yourself). By this way, we can have more flexible layout rather than limited the layout by grids. |
The result of both examples are about the same, only the button position has a bit different. (Please measure the exact position by yourself). By this way, we can have more flexible layout rather than limited the layout by grids. |
||
− | = Layout Reconfiguration = |
+ | === Layout Reconfiguration === |
We can also re-configure the layout by just simply re-assign a new layout value to the layout. But remember, do not assign the same tab to the layout twice, it will append the same tab to the notebook. To prevent this, assign an empty list to the notebook |
We can also re-configure the layout by just simply re-assign a new layout value to the layout. But remember, do not assign the same tab to the layout twice, it will append the same tab to the notebook. To prevent this, assign an empty list to the notebook |
||
Line 38: | Line 38: | ||
− | = See Also = |
+ | == See Also == |
[[Button Sizing Problem]] - It has problems to set the size of button |
[[Button Sizing Problem]] - It has problems to set the size of button |
Revision as of 20:52, 14 February 2006
Layout
All details are based on using wxHaskell on Microsoft Windows XP.
Layout setting by Gridding
In general, we can create layout by setting the layout argument in a frame or a panel, for example,
gui = do f <- frame [ text := "Layout" ] p <- panel f [] b <- button p [ text := "button" ] set f [ layout := margin 2 $ container p $ floatCenter $ widget b , clientSize := sz 100 100 ]
I will call this Layout setting by Gridding.
Gridding means using the layout function, such as grid, row, column etc, to set the layout.
Layout setting by Positioning
Also, we could set the layout by another way, Layout setting by Positioning
gui = do f <- frame [ text := "Layout" , clientSize := sz 100 100 ] p <- panel f [ clientSize := sz 98 98, , position := pt 2 2 ] b <- button p [ text := "button" , position := pt 45 45 ]
The result of both examples are about the same, only the button position has a bit different. (Please measure the exact position by yourself). By this way, we can have more flexible layout rather than limited the layout by grids.
Layout Reconfiguration
We can also re-configure the layout by just simply re-assign a new layout value to the layout. But remember, do not assign the same tab to the layout twice, it will append the same tab to the notebook. To prevent this, assign an empty list to the notebook
f <- frame [ text := "Layout" ] nb <- notebook f [] set f [ layout := tabs nb [] ]
See Also
Button Sizing Problem - It has problems to set the size of button