The windowSetLayout function takes Layout as its argument.
The widget combinator creates a layout from a window. The space combinator creates
an empty layout with a specific width and height. Furthermore, we have the label combinator
to create a static label label and boxed to create a labeled border around a layout.
The grid combinator lays out elements in a table with a given space between the elements.
Here is for example a layout for retrieving an x and y coordinate from the user, with 5 pixels space
between the controls:

Layout tranformers influence attributes of a layout. The margin combinator adds a
margin around a layout. The align combinators specify how a combinator is aligned when
the assigned area is larger than the layout itself. We can use these transformers to
add a margin around our dialog and to align the buttons to the bottom right (instead of the
default top-left):

Besides aligning a layout in its assigned area, we can also specify that a layout should
expand to fill the assigned area. The shaped combinator fills an area while maintaining the
original proportions (or aspect ratio) of a layout. The expand combinator always tries to fill
the entire area (and alignment is ignored).

The final attribute is the stretch of a layout. A stretchable layout may get a larger
area assigned than the minimally required area. This can be used to fill out the entire parent
area -- this happens for example when a user enlarges a dialog.

The default stretch and expansion mode of layout containers, like grid and boxed, depends on the
stretch of the child layouts. A column of a grid is only stretchable when all
elements of that column have horizontal stretch. The same holds for rows with vertical stretch.
When any column or row is stretchable, the grid itself will also be stretchable in that direction
and the grid will expand to fill the assigned area by default (instead of being static). Just like
a grid, other containers, like container, boxed, tabs, row, and column, will also propagate the stretch
and expansion mode of their child layouts.

Armed with the stretch combinators we can make our dialog resizeable.
We let the input widgets resize horizontally. Furthermore, the button row will resize
vertically and horizontally with the buttons aligned to the bottom right. Due to the
stretch propagation rules, the grid and boxed stretch horizontally and expand to fill the
assigned area. The horizontal row does not stretch by default (and we need to use
an explicit stretch) and it does not expand into the assigned area by default (and therefore
alignment works properly).

There are some common uses of stretchable combinators. The fill combinators combine
stretch and expansion. For example, hfill is defined as (hstretch . expand). The float
combinators combine alignment and stretch. For example, floatBottomRight is defined
as (stretch . alignBottomRight). There are also horizontal and vertical float combinators,
like hfloatCentre and vfloatBottom. Here is the above example using fill and float:

The glue combinators are stretchable empty space. For example, hglue
is defined as (hstretch (space 0 0)). We can use glue to mimic alignment. Here is the above
layout specified with glue. Note that we use hspace to manually insert
space between the elements or otherwise there would be space between the glue and
the ok button.

Splitter windows can also be specified with layout; you get somewhat less functionality
but it is quite convenient for most applications. A horizontal split is done using
hsplit while a vertical split is specified with a vsplit.

The layout for notebooks is specified with the tabs combinator. The following
example shows this (and note also how we use container to set the layout of panels):

The pages always need to be embedded inside a container (normally a Panel). The
title of the pages is determined from the label of the container widget.

Note: /At the moment, extra space is divided evenly among stretchable layouts. We plan to add
a (@proportion :: Int -> Layout -> Layout@) combinator in the future to stretch layouts
according to a relative weight, but unfortunately, that entails implementing a better
'FlexGrid' sizer for wxWindows./

Re-invoke layout algorithm to fit a window around its
children. It will enlarge when the current
client size is too small, but not shrink when the window
is already large enough. (in contrast, windowReLayoutMinimal will
also shrink a window so that it always minimally sized).

(primitive) The expression (grid w h rows) creates a grid of rows. The w argument
is the extra horizontal space between elements and h the extra vertical space between elements.
(implemented using the FlexGrid sizer).

Only when all elements of a column have horizontal stretch (see stretch and hstretch), the entire
column will stretch horizontally, and the same holds for rows with vertical stretch.
When any column or row in a grid can stretch, the grid itself will also stretch in that direction
and the grid will expand to fill the assigned area by default (instead of being static).

Create a notebook layout.
The pages always need to be embedded inside a container (normally a Panel).
Just like a grid, the horizontal or vertical stretch of the child layout determines
the stretch and expansion mode of the notebook.

Transformers

Adjust the minimal size of a control dynamically when the content changes.
This is used for example to correctly layout static text or buttons when the
text or label changes at runtime. This property is automatically set for
StaticText, labels, and buttons.

Stretch

(primitive) The layout is not stretchable. In a grid, the row and column that contain this layout will
not be resizeable. Note that a static layout can still be assigned an area that is larger
than its preferred size due to grid alignment constraints.
(default, except for containers like grid and boxed where it depends on the child layouts).