grid columnconfigure

grid columnconfigure master index ?-option value...?

Query or set the column properties of the index column of the geometry master, master. The valid options are -minsize, -weight, -uniform and -pad.

If one or more options are provided, then index may be given as a list of column indices to which the configuration options will operate on. Indices may be integers, window names or the keyword all. For all the options apply to all columns currently occupied be slave windows. For a window name, that window must be a slave of this master and the options apply to all columns currently occupied be the slave.

The -minsize option sets the minimum size, in screen units, that will be permitted for this column.

The -weight option (an integer value) sets the relative weight for apportioning any extra spaces among columns. A weight of zero (0) indicates the column will not deviate from its requested size. A column whose weight is two will grow at twice the rate as a column of weight one when extra space is allocated to the layout.

The -uniform option, when a non-empty value is supplied, places the column in a uniform group with other columns that have the same value for -uniform. The space for columns belonging to a uniform group is allocated so that their sizes are always in strict proportion to their -weight values.

The -pad option specifies the number of screen units that will be added to the largest window contained completely in that column when the grid geometry manager requests a size from the containing window. If only an option is specified, with no value, the current value of that option is returned.

If only the master window and index is specified, all the current settings are returned in an list of "-option value" pairs.

HaO 2010-10-21: Also columns without windows may have column configuration options. This is reflected by grid size.

Within the following example, the frame always covers one quarter of the master:

toplevel .t
grid [frame .t.f -bg yellow] -sticky news
grid columnconfigure .t {0 1} -weight 2
grid rowconfigure .t {0 1} -weight 2

Remark, that the special column specification all do not cover columns without windows. Continuing the upper example, one may add the following rows, to always cover 1/16 of the master:

grid columnconfigure .t all -weight 1
grid rowconfigure .t all -weight 1

The column specification all only covers column 0, because only this column has widgets.


See also