A grid sizer is a sizer which lays out its children in a
two-dimensional table with all cells having the same size. In other
words, the width of each cell within the grid is the width of the
widest item added to the sizer and the height of each grid cell is the
height of the tallest item. An optional vertical and/or horizontal
gap between items can also be specified (in pixels.)
Items are placed in the cells of the grid in the order they are added,
in row-major order. In other words, the first row is filled first,
then the second, and so on until all items have been added. (If
neccessary, additional rows will be added as items are added.) If you
need to have greater control over the cells that items are placed in
then use the wx.GridBagSizer
.
Method Summary |
GridSizer |
__init__ (self,
rows,
cols,
vgap,
hgap)
Constructor for a wx.GridSizer. |
(rows, cols) |
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. |
int |
GetCols (self)
Returns the number of columns in the sizer. |
int |
GetHGap (self)
Returns the horizontal gap (in pixels) between cells in the sizer. |
int |
GetRows (self)
Returns the number of rows in the sizer. |
int |
GetVGap (self)
Returns the vertical gap (in pixels) between the cells in the sizer. |
|
SetCols (self,
cols)
Sets the number of columns in the sizer. |
|
SetHGap (self,
gap)
Sets the horizontal gap (in pixels) between cells in the sizer |
|
SetRows (self,
rows)
Sets the number of rows in the sizer. |
|
SetVGap (self,
gap)
Sets the vertical gap (in pixels) between the cells in the sizer. |