******** wx.Sizer ******** Inheritance diagram for `wx.Sizer`: | .. inheritance-diagram:: wx.Sizer | Description =========== `wx.Sizer` is the abstract base class used for laying out subwindows in a window. You cannot use `wx.Sizer` directly; instead, you will have to use one of the sizer classes derived from it. Currently there are `wx.BoxSizer `_, `wx.StaticBoxSizer `_, `wx.GridSizer `_, `wx.FlexGridSizer `_ and `wx.GridBagSizer `_. The layout algorithm used by sizers in wxWidgets is closely related to layout in other GUI toolkits, such as Java's AWT, the GTK toolkit or the Qt toolkit. It is based upon the idea of the individual subwindows reporting their minimal required size and their ability to get stretched if the size of the parent window has changed. This will most often mean that the programmer does not set the original size of a dialog in the beginning, rather the dialog will be assigned a sizer and this sizer will be queried about the recommended size. The sizer in turn will query its children, which can be normal windows, empty space or other sizers, so that a hierarchy of sizers can be constructed. .. note:: Note that `wx.Sizer` does not derive from `wx.Window `_ and thus does not interfere with tab ordering and requires very little resources compared to a real window on screen. What makes sizers so well fitted for use in wxWidgets is the fact that every control reports its own minimal size and the algorithm can handle differences in font sizes or different window (dialog item) sizes on different platforms without problems. If e.g. the standard font as well as the overall design of Motif widgets requires more space than on Windows, the initial dialog size will automatically be bigger on Motif than on Windows. Sizers may also be used to control the layout of custom drawn items on the window. The `Add <#Add>`_, `Insert <#Insert>`_, and `Prepend <#Prepend>`_ functions return a pointer to the newly added `wx.SizerItem `_. Just add empty space of the desired size and attributes, and then use the `wx.SizerItem.GetRect `_ method to determine where the drawing operations should take place. A simple example on how to use sizers (`self` refers to a panel, for example):: sizer = wx.BoxSizer(wx.HORIZONTAL) button = wx.Button(self, -1, "Hello from wxPython!") sizer.Add(button, 0, wx.EXPAND | wx.ALL, 15) self.SetSizer(sizer) sizer.Layout() .. note:: **wxPython note:** If you wish to create a sizer class in wxPython you should derive the class from `wx.PySizer `_ in order to get Python-aware capabilities for the various virtual methods. Derived From ^^^^^^^^^^^^^ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.BoxSizer `_, `wx.FlexGridSizer `_, `wx.GridBagSizer `_, `wx.GridSizer `_, `wx.PySizer `_, `wx.StaticBoxSizer `_, `wx.StdDialogButtonSizer `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Add <#Add>`_ * `AddF <#AddF>`_ * `AddItem <#AddItem>`_ * `AddMany <#AddMany>`_ * `AddSizer <#AddSizer>`_ * `AddSpacer <#AddSpacer>`_ * `AddStretchSpacer <#AddStretchSpacer>`_ * `AddWindow <#AddWindow>`_ * `CalcMin <#CalcMin>`_ * `Clear <#Clear>`_ * `ComputeFittingClientSize <#ComputeFittingClientSize>`_ * `ComputeFittingWindowSize <#ComputeFittingWindowSize>`_ * `DeleteWindows <#DeleteWindows>`_ * `Detach <#Detach>`_ * `Fit <#Fit>`_ * `FitInside <#FitInside>`_ * `GetChildren <#GetChildren>`_ * `GetContainingWindow <#GetContainingWindow>`_ * `GetItem <#GetItem>`_ * `GetMinSize <#GetMinSize>`_ * `GetMinSizeTuple <#GetMinSizeTuple>`_ * `GetPosition <#GetPosition>`_ * `GetPositionTuple <#GetPositionTuple>`_ * `GetSize <#GetSize>`_ * `GetSizeTuple <#GetSizeTuple>`_ * `Hide <#Hide>`_ * `Insert <#Insert>`_ * `InsertF <#InsertF>`_ * `InsertItem <#InsertItem>`_ * `InsertSizer <#InsertSizer>`_ * `InsertSpacer <#InsertSpacer>`_ * `InsertStretchSpacer <#InsertStretchSpacer>`_ * `InsertWindow <#InsertWindow>`_ * `IsShown <#IsShown>`_ * `Layout <#Layout>`_ * `Prepend <#Prepend>`_ * `PrependF <#PrependF>`_ * `PrependItem <#PrependItem>`_ * `PrependSizer <#PrependSizer>`_ * `PrependSpacer <#PrependSpacer>`_ * `PrependStretchSpacer <#PrependStretchSpacer>`_ * `PrependWindow <#PrependWindow>`_ * `RecalcSizes <#RecalcSizes>`_ * `Remove <#Remove>`_ * `RemovePos <#RemovePos>`_ * `RemoveSizer <#RemoveSizer>`_ * `RemoveWindow <#RemoveWindow>`_ * `Replace <#Replace>`_ * `SetContainingWindow <#SetContainingWindow>`_ * `SetDimension <#SetDimension>`_ * `SetItemMinSize <#SetItemMinSize>`_ * `SetMinSize <#SetMinSize>`_ * `SetSizeHints <#SetSizeHints>`_ * `SetVirtualSizeHints <#SetVirtualSizeHints>`_ * `Show <#Show>`_ * `ShowItems <#ShowItems>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Children <#Children>`_ * `ContainingWindow <#ContainingWindow>`_ * `MinSize <#MinSize>`_ * `Position <#Position>`_ * `Size <#Size>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() The constructor. Note that `wx.Sizer` is an abstract base class and may not be instantiated. -------- .. method:: Add(item, proportion=0, flag=0, border=0, userData=None) Appends a child to the sizer. `wx.Sizer` itself is an abstract class, but the parameters are equivalent in the derived classes that you will instantiate to use it so they are described here: * `window`: The window to be added to the sizer. Its initial size (either set explicitly by the user or calculated internally when using `wx.DefaultSize`) is interpreted as the minimal and in many cases also the initial size. * `sizer`: The (child-)sizer to be added to the sizer. This allows placing a child sizer in a sizer and thus to create hierarchies of sizers (typically a vertical box as the top sizer and several horizontal boxes on the level beneath). * `width` and `height`: The dimension of a spacer to be added to the sizer. Adding spacers to sizers gives more flexibility in the design of dialogs; imagine for example a horizontal box with two buttons at the bottom of a dialog: you might want to insert a space between the two buttons and make that space stretchable using the `proportion` flag and the result will be that the left button will be aligned with the left side of the dialog and the right button with the right side -- the space in between will shrink and grow with the dialog. * `proportion`: Although the meaning of this parameter is undefined in `wx.Sizer`, it is used in `wx.BoxSizer `_ to indicate if a child of a sizer can change its size in the main orientation of the `wx.BoxSizer` -- where 0 stands for not changeable and a value of more than zero is interpreted relative to the value of other children of the same `wx.BoxSizer`. For example, you might have a horizontal `wx.BoxSizer` with three children, two of which are supposed to change their size with the sizer. Then the two stretchable windows would get a value of 1 each to make them grow and shrink equally with the sizer's horizontal dimension. * `flag`: This parameter can be used to set a number of flags which can be combined using the binary OR operator ``|``. Two main behaviours are defined using these flags. One is the border around a window: the border parameter determines the border width whereas the flags given here determine which side(s) of the item that the border will be added. The other flags determine how the sizer item behaves when the space allotted to the sizer changes, and is somewhat dependent on the specific kind of sizer used: +---------------------------------------------------------------------+-----------------------------------------------------------------------------+ | Sizer Flag | Description | +=====================================================================+=============================================================================+ | ``wx.TOP`` | These flags are used to specify which side(s) of the sizer | +---------------------------------------------------------------------+ item the border width will apply to. | | ``wx.BOTTOM`` | | +---------------------------------------------------------------------+ | | ``wx.LEFT`` | | +---------------------------------------------------------------------+ | | ``wx.RIGHT`` | | +---------------------------------------------------------------------+ | | ``wx.ALL`` | | +---------------------------------------------------------------------+-----------------------------------------------------------------------------+ | ``wx.EXPAND`` | The item will be expanded to fill the space assigned to | | | the item. | +---------------------------------------------------------------------+-----------------------------------------------------------------------------+ | ``wx.SHAPED`` | The item will be expanded as much as possible while also | | | maintaining its aspect ratio | +---------------------------------------------------------------------+-----------------------------------------------------------------------------+ | ``wx.FIXED_MINSIZE`` | Normally `wx.Sizers` will use | | | `wx.Window.GetAdjustedBestSize `_ to | | | determine what the minimal size of window items should be, and will use that| | | size to calculate the layout. This allows layouts to adjust when an item | | | changes and its best size becomes different. If you would rather have a | | | window item stay the size it started with then use ``wx.FIXED_MINSIZE``. | +---------------------------------------------------------------------+-----------------------------------------------------------------------------+ | ``wx.RESERVE_SPACE_EVEN_IF_HIDDEN`` | Normally `wx.Sizers` don't allocate space for hidden windows or other items.| | | This flag overrides this behavior so that sufficient space is allocated for | | | the window even if it isn't visible. This makes it possible to dynamically | | | show and hide controls without resizing parent dialog, for example. This | | | function is new since wxWidgets version 2.8.8 | +---------------------------------------------------------------------+-----------------------------------------------------------------------------+ | ``wx.ALIGN_CENTER`` **or** ``wx.ALIGN_CENTRE`` | The ``wx.ALIGN*`` flags allow you to specify the alignment of the item | +---------------------------------------------------------------------+ within the space allotted to it by the sizer, adjusted for the border if | | ``wx.ALIGN_LEFT`` | any. | +---------------------------------------------------------------------+ | | ``wx.ALIGN_RIGHT`` | | +---------------------------------------------------------------------+ | | ``wx.ALIGN_TOP`` | | +---------------------------------------------------------------------+ | | ``wx.ALIGN_BOTTOM`` | | +---------------------------------------------------------------------+ | | ``wx.ALIGN_CENTER_VERTICAL`` **or** ``wx.ALIGN_CENTRE_VERTICAL`` | | +---------------------------------------------------------------------+ | | ``wx.ALIGN_CENTER_HORIZONTAL`` **or** ``wx.ALIGN_CENTRE_HORIZONTAL``| | +---------------------------------------------------------------------+-----------------------------------------------------------------------------+ | * `border`: Determines the border width, if the flag parameter is set to include any border flag. * `userData`: Allows an extra object to be attached to the sizer item, for use in derived classes when sizing information is more complex than the proportion and flag will allow for. * `flags`: A `wx.SizerFlags `_ object that enables you to specify most of the above parameters more conveniently. | **Parameters:** * `item`: The item to add to the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) | **Returns:** `wx.SizerItem `_ -------- .. method:: AddF(item, sizerFlags) Similar to `Add <#Add>`_ but uses the `wx.SizerFlags `_ convenience class for setting the various flags, options and borders. **Parameters:** * `item`: The item to add to the sizer. * `sizerFlags` (`wx.SizerFlags `_) | **Returns:** `wx.SizerItem `_ -------- .. method:: AddItem(item) Adds a `wx.SizerItem `_ to the sizer. **Parameters:** * `item` (`wx.SizerItem `_) -------- .. method:: AddMany(items) `AddMany` is a convenience method for adding several items to a sizer at one time. Simply pass it a list of tuples, where each tuple consists of the parameters that you would normally pass to the `Add <#Add>`_ method. **Parameters:** * `items` (list of tuples) -------- .. method:: AddSizer(sizer, proportion=0, flag=0, border=0, userData=None) Compatibility alias for `Add <#Add>`_. **Parameters:** * `sizer` (`wx.Sizer `_): The item to add to the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) -------- .. method:: AddSpacer(size) Adds non-stretchable space to the sizer. More readable way of calling `Add(size, size, 0) <#Add>`_. **Parameters:** * `size` (int) | **Returns:** `wx.SizerItem `_ -------- .. method:: AddStretchSpacer(prop=1) Adds stretchable space to the sizer. More readable way of calling `Add(0, 0, prop) <#Add>`_. **Parameters:** * `prop` (int) | **Returns:** `wx.SizerItem `_ -------- .. method:: AddWindow(window, proportion=0, flag=0, border=0, userData=None) Compatibility alias for `Add <#Add>`_. **Parameters:** * `window` (`wx.Window `_): The item to add to the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) -------- .. method:: CalcMin() This method is abstract and has to be overwritten by any derived class. Here, the sizer will do the actual calculation of its children minimal sizes. | **Returns:** `wx.Size `_ -------- .. method:: Clear(delete_windows=False) Detaches all children from the sizer. If `delete_windows` is ``True`` then child windows will also be deleted. **Parameters:** * `delete_windows` (bool) -------- .. method:: ComputeFittingClientSize(window) Computes client area size for `window` so that it matches the sizer's minimal size. Unlike `GetMinSize <#GetMinSize>`_, this method accounts for other constraints imposed on `window`, namely display's size (returned size will never be too large for the display) and maximum window size if previously set by `wx.Window.SetMaxSize `_. The returned value is suitable for passing to `wx.Window.SetClientSize `_. This function is new since wxWidgets version 2.8.8 **Parameters:** * `window` (`wx.Window `_) | **Returns:** `wx.Size `_ .. seealso:: `ComputeFittingWindowSize <#ComputeFittingWindowSize>`_, `Fit <#Fit>`_ -------- .. method:: ComputeFittingWindowSize(window) Like `ComputeFittingClientSize <#ComputeFittingClientSize>`_, but converts the result into `window` size. The returned value is suitable for passing to `wx.Window.SetSize `_ or `wx.Window.SetMinSize `_. This function is new since wxWidgets version 2.8.8 **Parameters:** * `window` (`wx.Window `_) | **Returns:** `wx.Size `_ .. seealso:: `ComputeFittingClientSize <#ComputeFittingClientSize>`_, `Fit <#Fit>`_ -------- .. method:: DeleteWindows() Destroy all windows managed by the sizer. -------- .. method:: Detach(item) Detaches an item from the sizer without destroying it. This method does not cause any layout or resizing to take place, call `Layout <#Layout>`_ to do so. The `item` parameter can be either a window, a sizer, or the zero-based index of the item to be detached. Returns ``True`` if the child item was found and detached. **Parameters:** * `item` | **Returns:** `bool` .. seealso:: `Remove <#Remove>`_ -------- .. method:: Fit(window) Tell the sizer to resize the `window` to match the sizer's minimal size. This is commonly done in the constructor of the window itself. Returns the new size. **Parameters:** * `window` (`wx.Window `_) | **Returns:** `wx.Size `_ .. note:: For a top level window this is the total window size, not client size. .. seealso:: `ComputeFittingClientSize <#ComputeFittingClientSize>`_, `ComputeFittingWindowSize <#ComputeFittingWindowSize>`_ -------- .. method:: FitInside(window) Tell the sizer to resize the virtual size of the `window` to match the sizer's minimal size. This will not alter the on screen size of the window, but may cause the addition/removal/alteration of scrollbars required to view the virtual area in windows which manage it. **Parameters:** * `window` (`wx.Window `_) .. seealso:: `wx.ScrolledWindow.SetScrollbars `_, `SetVirtualSizeHints <#SetVirtualSizeHints>`_ -------- .. method:: GetChildren() Returns the list of the items in this sizer. The elements of the list `wx.SizerItemList` are objects of type `wx.SizerItem `_. | **Returns:** `list` -------- .. method:: GetContainingWindow() Returns the window this sizer is used in or ``None`` if none. | **Returns:** `wx.Window `_ -------- .. method:: GetItem(item, recursive=False) Returns the `wx.SizerItem` which holds the `item` given. The `item` parameter can be either a window, a sizer, or the zero-based index of the item to be found. Use parameter `recursive` to search in subsizers too. **Parameters:** * `window` * `recursive` (bool) | **Returns:** `wx.SizerItem `_ -------- .. method:: GetMinSize() Returns the minimal size of the sizer. This is either the combined minimal size of all the children and their borders or the minimal size set by `SetMinSize <#SetMinSize>`_, depending on which is bigger. | **Returns:** `wx.Size `_ .. note:: Note that the returned value is **client** size, not window size. In particular, if you use the value to set toplevel window's minimal or actual size, you should convert it using `wx.Window.ClientToWindowSize `_ before passing it to `wx.Window.SetMinSize `_ or `wx.Window.SetSize `_. -------- .. method:: GetMinSizeTuple() `No docstrings available for this method.` -------- .. method:: GetPosition() Returns the current position of the sizer. | **Returns:** `wx.Point `_ -------- .. method:: GetPositionTuple() `No docstrings available for this method.` -------- .. method:: GetSize() Returns the current size of the sizer. | **Returns:** `wx.Size `_ -------- .. method:: GetSizeTuple() `No docstrings available for this method.` -------- .. method:: Hide(item, recursive=False) A convenience method for `Show(item, False, recursive) <#Show>`_ Returns ``True`` if the child item was found, ``False`` otherwise. **Parameters:** * `item` * `recursive` (bool) | **Returns:** `bool` .. seealso:: `IsShown <#IsShown>`_, `Show <#Show>`_ -------- .. method:: Insert(before, item, proportion=0, flag=0, border=0, userData=None) Inserts a new item into the list of items managed by this sizer before the item at index `before`. **Parameters:** * `before` (int): The position before which to add the item. * `item`: The item to insert into the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) | **Returns:** `wx.SizerItem `_ .. seealso:: `Add <#Add>`_ -------- .. method:: InsertF(before, item, sizerFlags) Similar to `Insert <#Insert>`_, but uses the `wx.SizerFlags `_ convenience class for setting the various flags, options and borders. **Parameters:** * `before` (int): The position before which to add the item. * `item`: The item to add to the sizer. * `sizerFlags` (`wx.SizerFlags `_) | **Returns:** `wx.SizerItem `_ .. seealso:: `AddF <#AddF>`_ -------- .. method:: InsertItem(index, item) Inserts a `wx.SizerItem `_ to the sizer at the position given by `index`. **Parameters:** * `index` (int) * `item` (`wx.SizerItem `_) -------- .. method:: InsertSizer(before, sizer, proportion=0, flag=0, border=0, userData=None) Compatibility alias for `Insert <#Insert>`_. **Parameters:** * `before` (int): The index. * `sizer` (`wx.Sizer `_): The sizer to insert into the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) | **Returns:** `wx.SizerItem `_ -------- .. method:: InsertSpacer(index) Inserts non-stretchable space to the sizer. More readable way of calling `Insert(size, size, 0) <#Insert>`_. **Parameters:** * `index` (long) | **Returns:** `wx.SizerItem `_ -------- .. method:: InsertStretchSpacer(index, prop=1) Inserts stretchable space to the sizer. More readable way of calling `Insert(0, 0, prop) <#Insert>`_. **Parameters:** * `index` (long) * `prop` (int) | **Returns:** `wx.SizerItem `_ -------- .. method:: InsertWindow(before, window, proportion=0, flag=0, border=0, userData=None) Compatibility alias for `Insert <#Insert>`_. **Parameters:** * `before` (int): The index. * `window` (`wx.Window `_): The window to insert into the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) | **Returns:** `wx.SizerItem `_ -------- .. method:: IsShown(item) Determines if the item is currently shown. To make a sizer item disappear or reappear, use `Show <#Show>`_ followed by `Layout <#Layout>`_. The `item` parameter can be either a window, a sizer, or the zero-based index of the item. **Parameters:** * `item` | **Returns:** `bool` .. seealso:: `Hide <#Hide>`_, `Show <#Show>`_ -------- .. method:: Layout() Call this to force layout of the children anew, e.g. after having added a child to or removed a child (window, other sizer or space) from the sizer while keeping the current dimension. -------- .. method:: Prepend(item, proportion=0, flag=0, border=0, userData=None) Same as `Add <#Add>`_, but prepends the items to the beginning of the list of items (windows, subsizers or spaces) owned by this sizer. **Parameters:** * `item`: The item to prepend to the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) | **Returns:** `wx.SizerItem `_ -------- .. method:: PrependF(item, sizerFlags) Similar to `Prepend <#Prepend>`_ but uses the `wx.SizerFlags `_ convenience class for setting the various flags, options and borders. **Parameters:** * `item`: The item to prepend to the sizer. * `sizerFlags` (`wx.SizerFlags `_) | **Returns:** `wx.SizerItem `_ -------- .. method:: PrependItem(item) Prepends a `wx.SizerItem `_ to the sizer. **Parameters:** * `item` (`wx.SizerItem `_) -------- .. method:: PrependSizer(sizer, proportion=0, flag=0, border=0, userData=None) Compatibility alias for `Prepend <#Prepend>`_. **Parameters:** * `sizer` (`wx.Sizer `_): The sizer to prepend to the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) | **Returns:** `wx.SizerItem `_ -------- .. method:: PrependSpacer(size) Prepends non-stretchable space to the sizer. More readable way of calling `Prepend(size, size, 0) <#Prepend>`_. **Parameters:** * `size` (int) | **Returns:** `wx.SizerItem `_ -------- .. method:: PrependStretchSpacer(prop=1) Prepends stretchable space to the sizer. More readable way of calling `Prepend(0, 0, prop) <#Prepend>`_. **Parameters:** * `prop` (int) | **Returns:** `wx.SizerItem `_ -------- .. method:: PrependWindow(window, proportion=0, flag=0, border=0, userData=None) Compatibility alias for `Prepend <#Prepend>`_. **Parameters:** * `window` (`wx.Window `_): The window to prepend to the sizer. * `proportion` (int) * `flag` (int) * `border` (int) * `userData` (PyObject) | **Returns:** `wx.SizerItem `_ -------- .. method:: RecalcSizes() This method is abstract and has to be overwritten by any derived class. Here, the sizer will do the actual calculation of its children's positions and sizes. -------- .. method:: Remove(item) Removes an item from the sizer and destroys it. This method does not cause any layout or resizing to take place, call `Layout <#Layout>`_ to update the layout on screen after removing a child from the sizer. The *item* parameter can be either a window, a sizer, or the zero-based index of an item to remove. Returns ``True`` if the child item was found and removed. **Parameters:** * `item` | **Returns:** `bool` -------- .. method:: RemovePos(pos) Compatibility alias for `Remove <#Remove>`_. **Parameters:** * `pos` (int) | **Returns:** `bool` -------- .. method:: RemoveSizer(sizer) Compatibility alias for `Remove <#Remove>`_. **Parameters:** * `sizer` (`wx.Sizer `_) | **Returns:** `bool` -------- .. method:: RemoveWindow(window) Compatibility alias for `Remove <#Remove>`_. **Parameters:** * `window` (`wx.Window `_) | **Returns:** `bool` -------- .. method:: Replace(olditem, item, recursive=False) Detaches the given `olditem` from the sizer and replaces it with `item` which can be a window, sizer, or `wx.SizerItem `_. The detached child is destroyed only if it is not a window, (because windows are owned by their parent, not the sizer.) The `recursive` parameter can be used to search for the given element recursivly in subsizers. This method does not cause any layout or resizing to take place, call `Layout <#Layout>`_ to do so. Returns ``True`` if the child item was found and removed. **Parameters:** * `olditem` * `item` * `recursive` (bool) | **Returns:** `bool` -------- .. method:: SetContainingWindow(window) Set (or unset) the window this sizer is used in. **Parameters:** * `window` (`wx.Window `_) -------- .. method:: SetDimension(x, y, width, height) Call this to force the sizer to take the given dimension and thus force the items owned by the sizer to resize themselves according to the rules defined by the parameter in the `Add <#Add>`_ and `Prepend <#Prepend>`_ methods. **Parameters:** * `x` (int) * `y` (int) * `width` (int) * `height` (int) -------- .. method:: SetItemMinSize(item, size) Sets the minimum size that will be allocated for an item in the sizer. The `item` parameter can be either a window, a sizer, or the zero-based index of the item. If a window or sizer is given then it will be searched for recursivly in subsizers if neccessary. **Parameters:** * `item` * `size` (`wx.Size `_) -------- .. method:: SetMinSize(size) Call this to give the sizer a minimal size. Normally, the sizer will calculate its minimal size based purely on how much space its children need. After calling this method `GetMinSize <#GetMinSize>`_ will return either the minimal size as requested by its children or the minimal size set here, depending on which is bigger. **Parameters:** * `size` (int) -------- .. method:: SetSizeHints(window) This method first calls `Fit <#Fit>`_ and then `SetSizeHints <#SetSizeHints>`_ on the `window` passed to it. This only makes sense when `window` is actually a `wx.TopLevelWindow `_ such as a `wx.Frame `_ or a `wx.Dialog `_, since `SetSizeHints` only has any effect in these classes. It does nothing in normal windows or controls. This method is commonly invoked in the constructor of a toplevel window itself if the toplevel window is resizable. **Parameters:** * `window` (`wx.Window `_) -------- .. method:: SetVirtualSizeHints(window) Tell the sizer to set the minimal size of the `window` virtual area to match the sizer's minimal size. For windows with managed scrollbars this will set them appropriately. **Parameters:** * `window` (`wx.Window `_) .. seealso:: `wx.ScrolledWindow.SetScrollbars `_ -------- .. method:: Show(item, show=True, recursive=False) Shows or hides the item. To make a sizer item disappear or reappear, use `Show()` followed by `Layout <#Layout>`_. Use parameter `recursive` to show or hide elements found in subsizers. Returns ``True`` if the child item was found, ``False`` otherwise. **Parameters:** * `item` * `show` (bool) * `recursive` (bool) | **Returns:** `bool` .. seealso:: `Hide <#Hide>`_, `IsShown <#IsShown>`_ -------- .. method:: ShowItems(show) Recursively call `wx.SizerItem.Show `_ on all sizer items. **Parameters:** * `show` (bool) -------- Properties ^^^^^^^^^^ .. attribute:: Children See `GetChildren <#GetChildren>`_ .. attribute:: ContainingWindow See `GetContainingWindow <#GetContainingWindow>`_ and `SetContainingWindow <#SetContainingWindow>`_ .. attribute:: MinSize See `GetMinSize <#GetMinSize>`_ and `SetMinSize <#SetMinSize>`_ .. attribute:: Position See `GetPosition <#GetPosition>`_ .. attribute:: Size See `GetSize <#GetSize>`_