wx.GridSizer

Inheritance diagram for 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

Properties Summary

Class API

Methods

__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


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)


GetCols()

Returns the number of columns in the sizer.


Returns:

int


GetHGap()

Returns the horizontal gap (in pixels) between cells in the sizer.


Returns:

int


GetRows()

Returns the number of rows in the sizer.


Returns:

int


GetVGap()

Returns the vertical gap (in pixels) between the cells in the sizer.


Returns:

int


SetCols(cols)

Sets the number of columns in the sizer.

Parameters:

  • cols (int)

SetHGap(gap)

Sets the horizontal gap (in pixels) between cells in the sizer.

Parameters:

  • gap (int)

SetRows(rows)

Sets the number of rows in the sizer.

Parameters:

  • rows (int)

SetVGap(gap)

Sets the vertical gap (in pixels) between the cells in the sizer.

Parameters:

  • gap (int)

Properties

Cols
See GetCols and SetCols
HGap
See GetHGap and SetHGap
Rows
See GetRows and SetRows
VGap
See GetVGap and SetVGap