Through the use of the optional parameters in a sizer's various Add
methods, it is possible to control the relative proportions, alignment, and padding around every item that is managed by the sizer. Without using these additional settings, all the items in the sizer will just use their "best" minimum size and will be aligned to the top-left of the rectangle of space that the sizer provides. This means that the controls will not stretch or contract when the window is resized. Also, for example, if in a horizontal row of items in a BoxSizer
one of the items has a greater height than some of the other items in that same row, they may not be aligned as desired (see the following diagram).
This diagram illustrates an alignment issue that can occur when some controls have a different-sized rectangle than the one next to it. This is a realistic example of a problem that can occur on GTK (Linux), as its ComboBox
es tend to be much taller than a StaticTextCtrl...