The following methods are available on widgets managed by the grid manager:
Place the widget in a grid as described by the options (see below).
Remove the widget. The widget is not destroyed, and can be displayed again by grid or any other manager.
Return a dictionary containing the current options.
Remove the widget. The widget is not destroyed, and can be displayed again by grid or any other manager.
The following methods are available on widgets that are used as grid managers (that is, the geometry masters for widgets managed by the grid manager).
Set options for the given column (or row).
To change this for a given widget, you have to call this method on the widget's parent.
Table 27-1. Grid Manager Options
Option | Type | Description |
---|---|---|
minsize | integer | Defines the minimum size for the column (row). Note that if a column or row is completely empty, it will not be displayed, even if this option is set. |
pad | integer | Padding to add to the size of the largest widget in the column (row) when setting the size of the whole column. |
weight | integer | A relative weight used to distribute additional space between columns (rows). A column with the weight 2 will grow twice as fast as a column with weight 1. The default is 0, which means that the column will not grow at all. |
Returns the grid cell under (or closest to) the given pixel coordinate. The result is a 2-tuple: (column, row).
Enables or disables geometry propagation. When enabled, the grid manager attempts to change the size of the geometry master when a child widget changes size. Propagation is always enabled by default.
Returns the current grid size. This is defined as indexes of the first empty column and row in the grid, in that order. The result is a 2-tuple: (column, row).
Returns a list of the "slave" widgets managed by this widget. The widgets are returned as Tkinter widget references.