************ wx.GridSizer ************ Inheritance diagram for `wx.GridSizer`: | .. inheritance-diagram:: wx.GridSizer | Description =========== A grid sizer is a sizer which lays out its children in a two-dimensional table with all table fields having the same size, i.e. the width of each field is the width of the widest child, the height of each field is the height of the tallest child. Derived From ^^^^^^^^^^^^^ * `wx.Sizer `_ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.FlexGridSizer `_, `wx.GridBagSizer `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `CalcRowsCols <#CalcRowsCols>`_ * `GetCols <#GetCols>`_ * `GetHGap <#GetHGap>`_ * `GetRows <#GetRows>`_ * `GetVGap <#GetVGap>`_ * `SetCols <#SetCols>`_ * `SetHGap <#SetHGap>`_ * `SetRows <#SetRows>`_ * `SetVGap <#SetVGap>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Cols <#Cols>`_ * `HGap <#HGap>`_ * `Rows <#Rows>`_ * `VGap <#VGap>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__(rows=1, cols=0, vgap=0, hgap=0) Constructor for a `wx.GridSizer`. `rows` and `cols` determine the number of columns and rows in the sizer - if either of the parameters is zero, it will be calculated to from the total number of children in the sizer, thus making the sizer grow dynamically. `vgap` and `hgap` define extra space between all children. **Parameters:** * `rows` (int) * `cols` (int) * `vgap` (int) * `hgap` (int) | **Returns:** `wx.GridSizer `_ -------- .. method:: CalcRowsCols() Calculates how many rows and columns will be in the sizer based on the current number of items and also the rows, cols specified in the constructor. | **Returns:** `(rows, cols)` -------- .. method:: GetCols() Returns the number of columns in the sizer. | **Returns:** `int` -------- .. method:: GetHGap() Returns the horizontal gap (in pixels) between cells in the sizer. | **Returns:** `int` -------- .. method:: GetRows() Returns the number of rows in the sizer. | **Returns:** `int` -------- .. method:: GetVGap() Returns the vertical gap (in pixels) between the cells in the sizer. | **Returns:** `int` -------- .. method:: SetCols(cols) Sets the number of columns in the sizer. **Parameters:** * `cols` (int) -------- .. method:: SetHGap(gap) Sets the horizontal gap (in pixels) between cells in the sizer. **Parameters:** * `gap` (int) -------- .. method:: SetRows(rows) Sets the number of rows in the sizer. **Parameters:** * `rows` (int) -------- .. method:: SetVGap(gap) Sets the vertical gap (in pixels) between the cells in the sizer. **Parameters:** * `gap` (int) -------- Properties ^^^^^^^^^^ .. attribute:: Cols See `GetCols <#GetCols>`_ and `SetCols <#SetCols>`_ .. attribute:: HGap See `GetHGap <#GetHGap>`_ and `SetHGap <#SetHGap>`_ .. attribute:: Rows See `GetRows <#GetRows>`_ and `SetRows <#SetRows>`_ .. attribute:: VGap See `GetVGap <#GetVGap>`_ and `SetVGap <#SetVGap>`_