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.

1.3 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

2 Transformers

2.1 stretch + expand = fill

the widget's shape: how does a widget use the space around it? Your options are

rigid (default): fixed shape

shaped expands but retains proportions

expand just expands without caring about proportions

stretch

the widget's dynamic behaviour: OK so your widget is laid out and has expanded however much it wants to. Now what happens when you give it even more space by resizing the parent window? Your options are

static (default): no stretching!

stretch, hstretch, vstretch: stretches perhaps along one dimension only

minsize (not sure how this behaves)

TODO: screenshots

2.2 dynamic

??? how does this relate to expand/stretch?

3 Troubleshooting

3.1 Not in right place

Checklist

Did you use layout? Declaring the widget is not enough. You have to tell wxHaskell where it fits in wrt other widgets in the window

Did you put the layout in the right parent? (elaborate)

Do you need to use one of hfloatRight and hfloatLeft?

3.2 Too small

Problem: widgets do not resize when window is resizedSolution: make sure you are using the stretch combinators. Remember that columns only (h)stretch if all their members (h)stretch, and similarly for rows and vstretch.

3.3 Too big

Problem absurdly huge widgetPossible solution make sure the widget is placed in the correct parent.