diff options
Diffstat (limited to 'doc/grid.n')
-rw-r--r-- | doc/grid.n | 88 |
1 files changed, 56 insertions, 32 deletions
@@ -22,44 +22,44 @@ The \fBgrid\fR command can have any of several forms, depending on the \fIoption\fR argument: .TP \fBgrid \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR? +. If the first argument to \fBgrid\fR is suitable as the first slave argument to \fBgrid configure\fR, either a window name (any value -starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR +starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR (see the \fBRELATIVE PLACEMENT\fR section below), then the command is processed in the same way as \fBgrid configure\fR. -.VS 8.5 .TP \fBgrid anchor \fImaster\fR ?\fIanchor\fR? +. The anchor value controls how to place the grid within the master when no row/column has any weight. See \fBTHE GRID ALGORITHM\fR below for further details. The default \fIanchor\fR is \fInw\fR. -.VE 8.5 .TP \fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR? -With no arguments, +. +With no arguments, the bounding box (in pixels) of the grid is returned. The return value consists of 4 integers. The first two are the pixel offset from the master window (x then y) of the top-left corner of the grid, and the second two integers are the width and height of the grid, -also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on +also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on the command line, then the bounding box for that cell is returned, where the top left cell is numbered from zero. If both \fIcolumn\fR and \fIrow\fR arguments are specified, then the bounding box spanning the rows and columns indicated is returned. .TP \fBgrid columnconfigure \fImaster index \fR?\fI\-option value...\fR? -Query or set the column properties of the \fIindex\fR column of the +. +Query or set the column properties of the \fIindex\fR column of the geometry master, \fImaster\fR. The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR and \fB\-pad\fR. -If one or more options are provided, then \fIindex\fR may be given as +If one or more options are provided, then \fIindex\fR may be given as a list of column indices to which the configuration options will operate on. -.VS 8.5 Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR 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. -.VE 8.5 The \fB\-minsize\fR option sets the minimum size, in screen units, that will be permitted for this column. The \fB\-weight\fR option (an integer value) @@ -86,10 +86,11 @@ are returned in a list of pairs. .TP \fBgrid configure \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR? +. The arguments consist of the names of one or more slave windows followed by pairs of arguments that specify how to manage the slaves. -The characters \fB\-\fR, \fBx\fR and \fB^\fR, +The characters \fB\-\fR, \fBx\fR and \fB^\fR, can be specified instead of a window name to alter the default location of a \fIslave\fR, as described in the \fBRELATIVE PLACEMENT\fR section, below. @@ -97,6 +98,7 @@ The following options are supported: .RS .TP \fB\-column \fIn\fR +. Insert the slave so that it occupies the \fIn\fRth column in the grid. Column numbers start with 0. If this option is not supplied, then the slave is arranged just to the right of previous slave specified on this @@ -108,17 +110,20 @@ is incremented by one. Thus the \fBx\fR represents a blank column for this row in the grid. .TP \fB\-columnspan \fIn\fR +. Insert the slave so that it occupies \fIn\fR columns in the grid. The default is one column, unless the window name is followed by a \fB\-\fR, in which case the columnspan is incremented once for each immediately following \fB\-\fR. .TP \fB\-in \fIother\fR +. Insert the slave(s) in the master window given by \fIother\fR. The default is the first slave's parent window. .TP \fB\-ipadx \fIamount\fR +. The \fIamount\fR specifies how much horizontal internal padding to leave on each side of the slave(s). This is space is added inside the slave(s) border. @@ -126,12 +131,14 @@ The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR. It defaults to 0. .TP \fB\-ipady \fIamount\fR +. The \fIamount\fR specifies how much vertical internal padding to leave on the top and bottom of the slave(s). This space is added inside the slave(s) border. The \fIamount\fR defaults to 0. .TP \fB\-padx \fIamount\fR +. The \fIamount\fR specifies how much horizontal external padding to leave on each side of the slave(s), in screen units. \fIAmount\fR may be a list @@ -140,6 +147,7 @@ The \fIamount\fR defaults to 0. This space is added outside the slave(s) border. .TP \fB\-pady \fIamount\fR +. The \fIamount\fR specifies how much vertical external padding to leave on the top and bottom of the slave(s), in screen units. \fIAmount\fR may be a list @@ -148,12 +156,14 @@ The \fIamount\fR defaults to 0. This space is added outside the slave(s) border. .TP \fB\-row \fIn\fR +. Insert the slave so that it occupies the \fIn\fRth row in the grid. Row numbers start with 0. If this option is not supplied, then the slave is arranged on the same row as the previous slave specified on this call to \fBgrid\fR, or the first unoccupied row if this is the first slave. .TP \fB\-rowspan \fIn\fR +. Insert the slave so that it occupies \fIn\fR rows in the grid. The default is one row. If the next \fBgrid\fR command contains \fB^\fR characters instead of \fIslaves\fR that line up with the columns @@ -161,6 +171,7 @@ of this \fIslave\fR, then the \fBrowspan\fR of this \fIslave\fR is extended by one. .TP \fB\-sticky \fIstyle\fR +. If a slave's cell is larger than its requested dimensions, this option may be used to position (or stretch) the slave within its cell. \fIStyle\fR is a string that contains zero or more of the characters @@ -171,7 +182,7 @@ east, or west) that the slave will .QW stick to. If both \fBn\fR and \fBs\fR (or \fBe\fR and \fBw\fR) are specified, the slave will be stretched to fill the entire -height (or width) of its cavity. The \fBsticky\fR option subsumes the +height (or width) of its cavity. The \fB\-sticky\fR option subsumes the combination of \fB\-anchor\fR and \fB\-fill\fR that is used by \fBpack\fR. The default is .QW "" , @@ -183,6 +194,7 @@ than receiving default values. .RE .TP \fBgrid forget \fIslave \fR?\fIslave ...\fR? +. Removes each of the \fIslave\fRs from grid for its master and unmaps their windows. The slaves will no longer be managed by the grid geometry manager. @@ -191,6 +203,7 @@ slave is managed once more by the grid geometry manager, the initial default settings are used. .TP \fBgrid info \fIslave\fR +. Returns a list whose elements are the current configuration state of the slave given by \fIslave\fR in the same option-value form that might be specified to \fBgrid configure\fR. @@ -199,12 +212,14 @@ The first two elements of the list are where \fImaster\fR is the slave's master. .TP \fBgrid location \fImaster x y\fR -Given \fIx\fR and \fIy\fR values in screen units relative to the master window, +. +Given \fIx\fR and \fIy\fR values in screen units relative to the master window, the column and row number at that \fIx\fR and \fIy\fR location is returned. For locations that are above or to the left of the grid, \fB\-1\fR is returned. .TP \fBgrid propagate \fImaster\fR ?\fIboolean\fR? +. If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR then propagation is enabled for \fImaster\fR, which must be a window name (see \fBGEOMETRY PROPAGATION\fR below). @@ -217,18 +232,17 @@ for \fImaster\fR. Propagation is enabled by default. .TP \fBgrid rowconfigure \fImaster index \fR?\fI\-option value...\fR? -Query or set the row properties of the \fIindex\fR row of the +. +Query or set the row properties of the \fIindex\fR row of the geometry master, \fImaster\fR. The valid options are \fB\-minsize\fR, \fB\-weight\fR, \fB\-uniform\fR and \fB\-pad\fR. -If one or more options are provided, then \fIindex\fR may be given as +If one or more options are provided, then \fIindex\fR may be given as a list of row indices to which the configuration options will operate on. -.VS 8.5 Indices may be integers, window names or the keyword \fIall\fR. For \fIall\fR the options apply to all rows currently occupied be slave windows. For a window name, that window must be a slave of this master and the options apply to all rows currently occupied be the slave. -.VE 8.5 The \fB\-minsize\fR option sets the minimum size, in screen units, that will be permitted for this row. The \fB\-weight\fR option (an integer value) @@ -255,6 +269,7 @@ are returned in a list of pairs. .TP \fBgrid remove \fIslave \fR?\fIslave ...\fR? +. Removes each of the \fIslave\fRs from grid for its master and unmaps their windows. The slaves will no longer be managed by the grid geometry manager. @@ -264,12 +279,14 @@ slave is managed once more by the grid geometry manager, the previous values are retained. .TP \fBgrid size \fImaster\fR +. Returns the size of the grid (in columns then rows) for \fImaster\fR. The size is determined either by the \fIslave\fR occupying the largest -row or column, or the largest column or row with a \fBminsize\fR, -\fBweight\fR, or \fBpad\fR that is non-zero. +row or column, or the largest column or row with a \fB\-minsize\fR, +\fB\-weight\fR, or \fB\-pad\fR that is non-zero. .TP \fBgrid slaves \fImaster\fR ?\fI\-option value\fR? +. If no options are supplied, a list of all of the slaves in \fImaster\fR are returned, most recently manages first. \fIOption\fR can be either \fB\-row\fR or \fB\-column\fR which @@ -278,13 +295,13 @@ to be returned. .SH "RELATIVE PLACEMENT" .PP The \fBgrid\fR command contains a limited set of capabilities that -permit layouts to be created without specifying the row and column -information for each slave. This permits slaves to be rearranged, +permit layouts to be created without specifying the row and column +information for each slave. This permits slaves to be rearranged, added, or removed without the need to explicitly specify row and column information. -When no column or row information is specified for a \fIslave\fR, +When no column or row information is specified for a \fIslave\fR, default values are chosen for -\fBcolumn\fR, \fBrow\fR, \fBcolumnspan\fR and \fBrowspan\fR +\fB\-column\fR, \fB\-row\fR, \fB\-columnspan\fR and \fB\-rowspan\fR at the time the \fIslave\fR is managed. The values are chosen based upon the current layout of the grid, the position of the \fIslave\fR relative to other \fIslave\fRs in the same grid command, and the presence @@ -293,17 +310,20 @@ command where \fIslave\fR names are normally expected. .RS .TP \fB\-\fR -This increases the columnspan of the \fIslave\fR to the left. Several -\fB\-\fR's in a row will successively increase the columnspan. A \fB\-\fR +. +This increases the \fB\-columnspan\fR of the \fIslave\fR to the left. Several +\fB\-\fR's in a row will successively increase the number of columns spanned. A \fB\-\fR may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIslave\fR argument to \fBgrid configure\fR. .TP \fBx\fR +. This leaves an empty column between the \fIslave\fR on the left and the \fIslave\fR on the right. .TP \fB^\fR -This extends the \fBrowspan\fR of the \fIslave\fR above the \fB^\fR's +. +This extends the \fB\-rowspan\fR of the \fIslave\fR above the \fB^\fR's in the grid. The number of \fB^\fR's in a row must match the number of columns spanned by the \fIslave\fR above it. .RE @@ -320,12 +340,12 @@ For the final step, each slave is positioned in its row(s) and column(s) based on the setting of its \fIsticky\fR flag. .PP To compute the minimum size of a layout, the grid geometry manager -first looks at all slaves whose columnspan and rowspan values are one, +first looks at all slaves whose \fB\-columnspan\fR and \fB\-rowspan\fR values are one, and computes the nominal size of each row or column to be either the \fIminsize\fR for that row or column, or the sum of the \fIpad\fRding plus the size of the largest slave, whichever is greater. After that the rows or columns in each uniform group adapt to each other. Then -the slaves whose rowspans or columnspans are greater than one are +the slaves whose row-spans or column-spans are greater than one are examined. If a group of rows or columns need to be increased in size in order to accommodate these slaves, then extra space is added to each row or column in the group according to its \fIweight\fR. For each @@ -337,9 +357,9 @@ allocated to them is always in proportion to their weights. (A weight of zero is considered to be 1.) In other words, a row or column configured with \fB\-weight 1 \-uniform a\fR will have exactly the same size as any other row or column configured with \fB\-weight 1 \-uniform -a\fR. A row or column configured with \fB\-weight 2 \-uniform b\fR will +a\fR. A row or column configured with \fB\-weight 2 \-uniform b\fR will be exactly twice as large as one that is configured with \fB\-weight 1 -\-uniform b\fR. +\-uniform b\fR. .PP More technically, each row or column in the group will have a size equal to \fIk*weight\fR for some constant \fIk\fR. The constant @@ -348,18 +368,16 @@ minimum size. For example, if all rows or columns in a group have the same weight, then each row or column will have the same size as the largest row or column in the group. .PP -.VS 8.5 For masters whose size is larger than the requested layout, the additional space is apportioned according to the row and column weights. If all of the weights are zero, the layout is placed within its master according to the \fIanchor\fR value. For masters whose size is smaller than the requested layout, space is taken -away from columns and rows according to their weights. However, once a +away from columns and rows according to their weights. However, once a column or row shrinks to its minsize, its weight is taken to be zero. If more space needs to be removed from a layout than would be permitted, as when all the rows or columns are at their minimum sizes, the layout is placed and clipped according to the \fIanchor\fR value. -.VE 8.5 .SH "GEOMETRY PROPAGATION" .PP The grid geometry manager normally computes how large a master must be to @@ -397,7 +415,9 @@ The \fBgrid\fR command is based on ideas taken from the \fIGridBag\fR geometry manager written by Doug. Stein, and the \fBblt_table\fR geometry manager, written by George Howlett. .SH EXAMPLES +.PP A toplevel window containing a text widget and two scrollbars: +.PP .CS # Make the widgets toplevel .t @@ -417,6 +437,7 @@ scrollbar .t.h \-orient horizontal \-command {.t.txt xview} Three widgets of equal width, despite their different .QW natural widths: +.PP .CS button .b \-text "Foo" entry .e \-variable foo @@ -429,3 +450,6 @@ label .l \-text "This is a fairly long piece of text" pack(n), place(n) .SH KEYWORDS geometry manager, location, grid, cell, propagation, size, pack +'\" Local Variables: +'\" mode: nroff +'\" End: |