www.gibmonks.com

  Previous section   Next section

Practical Programming in Tcl & Tk, Third Edition
By Brent B. Welch

Table of Contents
Chapter 24.  The Grid Geometry Manager


The grid Command

Table 24-1 summarizes the usage of the grid command.

Table 24-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, and -pad.
grid configure win ?win ...? ?options?Grids one or more widgets according to the options, which are given in Table 24-2.
grid forget win ?win...?Unmaps the specified windows.
grid info winReturns the grid parameters of win.
grid location master x yReturns 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, and -pad.
grid remove slaveUnmaps slave, but remember its configuration.
grid size masterReturns 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 24-2 summarizes the grid options for a widget. These are set with the grid configure command, and the current settings are returned by the grid info command.

Table 24-2. Grid widget options.
-in winPlaces inside win.
-column colColumn position. Columns count from zero.
-columnspan nSpans n columns.
-ipadx pixelsInternal widget padding in the X direction, in screen units.
-ipady pixelsInternal widget padding in the Y direction, in screen units.
-padx pixelsExternal widget padding in the X direction, in screen units.
-pady pixelsExternal widget padding in the Y direction, in screen units.
-row rowRow position. Rows count from zero.
-rowspan nSpans n rows.
-sticky howPositions widget next to any combination of north (n), south (s), east (w), and west (e) sides of the cell. Use {} for center.


      Previous section   Next section
    Top