[ Team LiB ] Previous Section Next Section

The grid Command

Table 26-1 summarizes the usage of the grid command. Table 26-2 summarizes the options for a widget set with the grid configure command.

Table 26-1. The grid command

grid bbox master ?c1 r1? ?c2 r2?

Returns the bounding box, of the whole grid, the cell at c1, r1, or the cells from c1, r1 to c2, r2.

grid columnconfigure master col ?options?

Sets or queries the configuration of col. Options are -minsize, -weight, -pad, and -uniform.

grid configure win ?win ...? ?options?

Grids one or more widgets according to the options, which are given in Table 26-2.

grid forget win ?win...?

Unmaps the specified windows.

grid info win

Returns the grid options of win.

grid location master x y

Returns the cell column and row under the point x, y in master.

grid propagate master ?boolean?

Enables or disables shrink-wrapping of master.

grid rowconfigure master row ?options?

Sets or queries the configuration of row. Options are -minsize, -weight, -pad, and -uniform.

grid remove slave

Unmaps slave, but remember its configuration.

grid size master

Returns the number of columns and rows.

grid slaves win ?-row r? ?-column c?

Returns the list of widgets managed by win, or just those in the specified row or column.

Table 26-2. Grid widget options

-in win

Places inside win.

-column col

Column position. Columns count from zero.

-columnspan n

Spans n columns.

-ipadx pixels

Internal widget padding in the X direction, in screen units.

-ipady pixels

Internal widget padding in the Y direction, in screen units.

-padx pixels

External widget padding in the X direction, in screen units. May be a list of two screen units for asymmetric padding (Tk 8.4).

-pady pixels

External widget padding in the Y direction, in screen units. May be a list of two screen units for asymmetric padding (Tk 8.4).

-row row

Row position. Rows count from zero.

-rowspan n

Spans n rows.

-sticky how

Positions widget next to any combination of north (n), south (s), east (e), and west (w) sides of the cell. Use {} for center.

    [ Team LiB ] Previous Section Next Section