summaryrefslogtreecommitdiff
path: root/tk/doc/grid.n
diff options
context:
space:
mode:
Diffstat (limited to 'tk/doc/grid.n')
-rw-r--r--tk/doc/grid.n71
1 files changed, 56 insertions, 15 deletions
diff --git a/tk/doc/grid.n b/tk/doc/grid.n
index d4a8ac844dc..ee40d2169c9 100644
--- a/tk/doc/grid.n
+++ b/tk/doc/grid.n
@@ -7,7 +7,7 @@
'\" RCS: @(#) $Id$
'\"
.so man.macros
-.TH grid n 4.1 Tk "Tk Built-In Commands"
+.TH grid n 8.4 Tk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
@@ -25,9 +25,11 @@ 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 a window name (any value
-starting with ``.''), then the command is processed in the same
-way as \fBgrid configure\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.\fP) or one of the characters \fBx\fP or \fB^\fP
+(see the ``RELATIVE PLACEMENT'' section below), then the command is
+processed in the same way as \fBgrid configure\fR.
.TP
\fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR?
With no arguments,
@@ -44,11 +46,12 @@ indicated is returned.
\fBgrid columnconfigure \fImaster index \fR?\fI\-option value...\fR?
Query or set the column properties of the \fIindex\fP column of the
geometry master, \fImaster\fP.
-The valid options are \fB\-minsize\fP, \fB\-weight\fP and \fB-pad\fP.
-.VS
+.VS 8.4
+The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
+and \fB-pad\fP.
+.VE
If one or more options are provided, then \fIindex\fP may be given as
a list of column indeces to which the configuration options will operate on.
-.VE
The \fB\-minsize\fP option sets the minimum size, in screen units,
that will be permitted for this column.
The \fB\-weight\fP option (an integer value)
@@ -58,6 +61,14 @@ 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.
+.VS 8.4
+The \fB-uniform\fP option, when a non-empty value is supplied, places
+the column in a \fIuniform group\fP with other columns that have the
+same value for \fB-uniform\fP. The space for columns belonging to a
+uniform group is allocated so that their sizes are always in strict
+proportion to their \fB-weight\fP values. See
+``THE GRID ALGORITHM'' below for further details.
+.VE
The \fB-pad\fP 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.
@@ -113,12 +124,16 @@ The \fIamount\fR defaults to 0.
\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
+of two values to specify padding for left and right separately.
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
+of two values to specify padding for top and bottom separately.
The \fIamount\fR defaults to 0.
This space is added outside the slave(s) border.
.TP
@@ -189,11 +204,12 @@ Propagation is enabled by default.
\fBgrid rowconfigure \fImaster index \fR?\fI\-option value...\fR?
Query or set the row properties of the \fIindex\fP row of the
geometry master, \fImaster\fP.
-The valid options are \fB\-minsize\fP, \fB\-weight\fP and \fB-pad\fP.
-.VS
+.VS 8.4
+The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
+and \fB-pad\fP.
+.VE
If one or more options are provided, then \fIindex\fP may be given as
a list of row indeces to which the configuration options will operate on.
-.VE
The \fB\-minsize\fP option sets the minimum size, in screen units,
that will be permitted for this row.
The \fB\-weight\fP option (an integer value)
@@ -203,6 +219,14 @@ rows.
A weight of zero (0) indicates the row will not deviate from its requested
size. A row whose weight is two will grow at twice the rate as a row
of weight one when extra space is allocated to the layout.
+.VS 8.4
+The \fB-uniform\fP option, when a non-empty value is supplied, places
+the row in a \fIuniform group\fP with other rows that have the
+same value for \fB-uniform\fP. The space for rows belonging to a
+uniform group is allocated so that their sizes are always in strict
+proportion to their \fB-weight\fP values. See
+``THE GRID ALGORITHM'' below for further details.
+.VE
The \fB-pad\fP option specifies the number of screen units that will be
added to the largest window contained completely in that row when the
grid geometry manager requests a size from the containing window.
@@ -245,14 +269,15 @@ default values are chosen for
at the time the \fIslave\fP is managed. The values are chosen
based upon the current layout of the grid, the position of the \fIslave\fP
relative to other \fIslave\fPs in the same grid command, and the presence
-of the characters \fB\-\fP, \fB^\fP, and \fB^\fP in \fBgrid\fP
+of the characters \fB\-\fP, \fBx\fP, and \fB^\fP in \fBgrid\fP
command where \fIslave\fP names are normally expected.
.RS
.TP
\fB\-\fP
This increases the columnspan of the \fIslave\fP to the left. Several
\fB\-\fP's in a row will successively increase the columnspan. A \fB\-\fP
-may not follow a \fB^\fP or a \fBx\fP.
+may not follow a \fB^\fP or a \fBx\fP, nor may it be the first \fIslave\fP
+argument to \fBgrid configure\fR.
.TP
\fBx\fP
This leaves an empty column between the \fIslave\fP on the left and
@@ -279,14 +304,31 @@ To compute the minimum size of a layout, the grid geometry manager
first looks at all slaves whose columnspan and rowspan values are one,
and computes the nominal size of each row or column to be either the
\fIminsize\fP for that row or column, or the sum of the \fIpad\fPding
-plus the size of the largest slave, whichever is greater. Then the
-slaves whose rowspans or columnspans are greater than one are
+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
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\fP. For each
group whose weights are all zero, the additional space is apportioned
equally.
.PP
+When multiple rows or columns belong to a uniform group, the space
+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\fP will have exactly the same
+size as any other row or column configured with \fB-weight 1 -uniform
+a\fP. 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\fP.
+.PP
+More technically, each row or column in the group will have a size
+equal to \fIk*weight\fP for some constant \fIk\fP. The constant
+\fIk\fP is chosen so that no row or column becomes smaller than its
+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
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 centered within its master.
@@ -335,4 +377,3 @@ geometry manager written by Doug. Stein, and the \fBblt_table\fR geometry
manager, written by George Howlett.
.SH KEYWORDS
geometry manager, location, grid, cell, propagation, size, pack
-