head	1.23;
access;
symbols
	core-8-5-9:1.20.2.1
	core-8-5-8:1.20.2.1
	macosx-cocoa-merge:1.22
	macosx-cocoa-premerge:1.22
	macosx-carbon-freeze:1.22
	core-8-5-7:1.20
	core-8-5-6:1.20
	core-8-6-b1:1.22
	core-8-6-a3:1.22
	core-8-5-5:1.20
	core-8-6-a2:1.21
	core-8-5-4:1.20
	core-8-5-3:1.20
	core-8-6-a1:1.20
	core-8-4-19:1.5.4.3
	core-8-5-branch:1.20.0.2
	core-8-5-2:1.20
	core-8-4-18:1.5.4.3
	core-8-5-1:1.20
	core-8-4-17:1.5.4.3
	core-8-5-0:1.20
	core-8-5-b3:1.19
	core-8-5-b2:1.17
	core-8-4-16:1.5.4.3
	core-8-5-b1:1.15
	core-stablilizer-merge:1.15
	core-stabilizer-branch:1.15.0.2
	core-stabilizer-merge:1.20
	core-8-4-15:1.5.4.3
	core-8-5-a6:1.15
	core-8-5-a5:1.14
	core-8-4-14:1.5.4.3
	core-8-5-a4:1.14
	core-8-4-13:1.5.4.3
	core-8-4-12:1.5.4.3
	core-8-4-11:1.5.4.3
	core-8-5-a3:1.14
	core-8-4-10:1.5.4.3
	core-8-4-9-branch:1.5.4.3.0.2
	core-8-5-a2:1.14
	core-8-4-9:1.5.4.3
	core-8-4-8:1.5.4.3
	core-8-4-7:1.5
	core-8-5-a1:1.8
	core-8-4-6:1.5
	core-8-4-5:1.5
	mistachkin-dev-branch:1.6.0.2
	core-8-4-4:1.5
	core-8-4-3:1.5
	core-8-4-branch:1.5.0.4
	core-8-4-2:1.5
	core-8-4-1:1.5
	core-8-3-5:1.2.18.2
	core-8-4-0:1.5
	macosx-8-4-merge-2002-08-31-trunk:1.5
	macosx-8-4-premerge-2002-08-31-branch:1.5
	macosx-8-4-premerge-2002-08-31-trunk:1.5
	macosx-8-4-merge-2002-08-30-branch:1.5
	macosx-8-4-merge-2002-08-30-trunk:1.5
	macosx-8-4-merge-2002-08-20-branch:1.5
	macosx-8-4-merge-2002-08-20-trunk:1.5
	core-8-4-b2:1.5
	core-8-4-b1:1.5
	macosx-premerge-6-9-02:1.5
	core-8-4-a4:1.5
	core-8-3-4:1.2.18.2
	macosx-8-4-branch:1.5.0.2
	macosx-8-4-branchpoint:1.5
	core-8-4-a3:1.3
	core-8-3-3:1.2.18.2
	dgp-privates-into-namespace:1.3.0.2
	tclpro-1-5-0:1.2
	core-8-4-win-speedup:1.2.0.20
	core-8-4-a2:1.2
	tclpro-1-4-1:1.2
	tclpro-1-4-0:1.2
	core-8-3-2:1.2
	ajuba-ajuba2-2-1-base:1.2
	ajuba-ajuba2-2-0:1.2
	core-8-4-a1:1.2
	core-8-3-1-branch:1.2.0.18
	core-8-3-1:1.2
	scriptics-sc-2-0-b5:1.2
	scriptics-sc-2-0-fixed:1.2
	scriptics-sc-2-0-b2:1.2
	scriptics-sc-2-0-b1:1.2
	core-8-3-0:1.2
	core-8-3-b2:1.2
	core-8-3-b1:1.2
	scriptics-sc-1-1:1.2
	scriptics-sc-1-1-b1:1.2
	core-8-2-3:1.2
	scriptics-sc-1-1-branch:1.2.0.16
	scriptics-sc-1-1-base:1.2
	scriptics-sc-1-0:1.2
	scriptics-sc-1-0-branch:1.2.0.14
	scriptics-sc-1-0-base:1.2
	core-8-2-2:1.2
	core-8-2-1:1.2
	scriptics-bc-1-0-b1:1.2
	core-8-2-1-branch:1.2.0.12
	scriptics-tclpro-1-3-0:1.2
	core-8-2-0:1.2
	core-8-2-b3-branch:1.2.0.10
	core-8-2-b3-base:1.2
	scriptics-tclpro-1-3-b4:1.2
	core-8-2-b2:1.2
	scriptics-tclpro-1-3-b3:1.2
	core-8-2-b1:1.2
	scriptics-tclpro-1-3-b2:1.2
	merge-to-mainline-5/21/99:1.2
	scriptics-tclpro-1-3-b2-branch:1.2.0.8
	core-8-1-1:1.2
	scriptics-tclpro-1-3-b1:1.2
	core-8-1-1-base:1.2
	core-8-1-0:1.2
	merge-to-mainline-4-29-99:1.2
	merge-to-mainline-4-23-99:1.2
	core-8-1-branch-old:1.1.0.4
	core-8-0-6-branch:1.2.0.6
	core-8-0-6-base:1.2
	core-8-0-5:1.2
	core-8-1-b3:1.1.4.1
	core-8-1-b2:1.1.4.1
	dev-8-1-stubs-branch:1.1.4.1.0.2
	dev-stubs-branch:1.2.0.4
	scriptics-tclpro-1-2:1.2
	scriptics-tclpro-1-2-b2:1.2
	core-8-1-merge-2/10/99:1.2
	core-8-0-5-branch:1.2.0.2
	core-8-0-5-base:1.2
	scriptics-tclpro-1-2-b1:1.2
	scriptics-tclpro-1-2-a1:1.2
	core-8-1-b1:1.1.4.1
	core-8-0-4:1.2
	core-8-1-a2:1.1
	core-8-0-2:1.1
	core-8-0-3:1.2;
locks; strict;
comment	@# @;


1.23
date	2009.07.11.07.25.32;	author dkf;	state Exp;
branches;
next	1.22;

1.22
date	2008.09.23.13.36.40;	author dkf;	state Exp;
branches;
next	1.21;

1.21
date	2008.06.30.22.57.02;	author dkf;	state Exp;
branches;
next	1.20;

1.20
date	2007.12.13.15.23.43;	author dgp;	state Exp;
branches
	1.20.2.1;
next	1.19;

1.19
date	2007.10.29.21.19.42;	author dkf;	state Exp;
branches;
next	1.18;

1.18
date	2007.10.29.16.04.13;	author dkf;	state Exp;
branches;
next	1.17;

1.17
date	2007.10.26.20.13.23;	author dgp;	state Exp;
branches;
next	1.16;

1.16
date	2007.10.24.14.32.58;	author dkf;	state Exp;
branches;
next	1.15;

1.15
date	2006.11.15.13.29.17;	author dkf;	state Exp;
branches
	1.15.2.1;
next	1.14;

1.14
date	2004.10.29.07.53.15;	author dkf;	state Exp;
branches;
next	1.13;

1.13
date	2004.10.28.10.22.51;	author dkf;	state Exp;
branches;
next	1.12;

1.12
date	2004.09.19.16.05.37;	author dkf;	state Exp;
branches;
next	1.11;

1.11
date	2004.08.20.10.56.36;	author dkf;	state Exp;
branches;
next	1.10;

1.10
date	2004.06.21.14.41.42;	author dkf;	state Exp;
branches;
next	1.9;

1.9
date	2004.06.21.14.40.15;	author dkf;	state Exp;
branches;
next	1.8;

1.8
date	2004.03.04.00.17.07;	author hobbs;	state Exp;
branches;
next	1.7;

1.7
date	2004.01.09.22.23.26;	author pspjuth;	state Exp;
branches;
next	1.6;

1.6
date	2003.09.18.18.22.22;	author pspjuth;	state Exp;
branches;
next	1.5;

1.5
date	2001.09.30.19.01.58;	author pspjuth;	state Exp;
branches
	1.5.4.1;
next	1.4;

1.4
date	2001.08.18.20.03.16;	author pspjuth;	state Exp;
branches;
next	1.3;

1.3
date	2001.02.12.18.06.47;	author drh;	state Exp;
branches;
next	1.2;

1.2
date	98.09.14.18.22.56;	author stanton;	state Exp;
branches
	1.2.18.1
	1.2.20.1;
next	1.1;

1.1
date	98.04.01.09.39.52;	author rjohnson;	state Exp;
branches
	1.1.4.1;
next	;

1.1.4.1
date	98.09.30.02.16.19;	author stanton;	state Exp;
branches;
next	;

1.2.18.1
date	2001.04.04.07.23.48;	author hobbs;	state Exp;
branches;
next	1.2.18.2;

1.2.18.2
date	2001.04.04.18.15.54;	author hobbs;	state Exp;
branches;
next	;

1.2.20.1
date	2002.04.02.20.57.53;	author hobbs;	state Exp;
branches;
next	;

1.5.4.1
date	2004.10.28.10.19.29;	author dkf;	state Exp;
branches;
next	1.5.4.2;

1.5.4.2
date	2004.10.29.07.51.04;	author dkf;	state Exp;
branches;
next	1.5.4.3;

1.5.4.3
date	2004.10.29.07.52.08;	author dkf;	state Exp;
branches;
next	;

1.15.2.1
date	2007.11.01.16.37.14;	author dgp;	state Exp;
branches;
next	;

1.20.2.1
date	2009.07.11.07.30.24;	author dkf;	state Exp;
branches;
next	;


desc
@@


1.23
log
@[Bug 2818455]: Corrected example.
@
text
@'\"
'\" Copyright (c) 1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\" 
'\" RCS: @@(#) $Id: grid.n,v 1.22 2008/09/23 13:36:40 dkf Exp $
'\" 
.so man.macros
.TH grid n 8.5 Tk "Tk Built-In Commands"
.BS
'\" Note:  do not modify the .SH NAME line immediately below!
.SH NAME
grid \- Geometry manager that arranges widgets in a grid
.SH SYNOPSIS
\fBgrid \fIoption arg \fR?\fIarg ...\fR?
.BE
.SH DESCRIPTION
.PP
The \fBgrid\fR command is used to communicate with the grid
geometry manager that arranges widgets in rows and columns inside
of another window, called the geometry master (or master window).
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
(see the \fBRELATIVE PLACEMENT\fR section below), then the command is
processed in the same way as \fBgrid configure\fR.
.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.
.TP
\fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR?
.
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
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
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
a list of column indices to which the configuration options will operate on.
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.
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)
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 \fB\-uniform\fR option, when a non-empty value is supplied, places
the column in a \fIuniform group\fR with other columns that have the
same value for \fB\-uniform\fR.  The space for columns belonging to a
uniform group is allocated so that their sizes are always in strict
proportion to their \fB\-weight\fR values.  See
\fBTHE GRID ALGORITHM\fR below for further details.
The \fB\-pad\fR 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 a list of
.QW "\-option value"
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,
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.
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
call to \fBgrid\fR, or column
.QW 0
if it is the first slave.  For each
\fBx\fR that immediately precedes the \fIslave\fR, the column position
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.
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
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
\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
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
\fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR.
The string can optionally contains spaces or
commas, but they are ignored.  Each letter refers to a side (north, south,
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
combination of \fB\-anchor\fR and \fB\-fill\fR that is used by \fBpack\fR.
The default is
.QW "" ,
which causes the slave to be centered in its cavity, at its requested size.
.LP
If any of the slaves are already managed by the geometry manager
then any unspecified options for them retain their previous values rather
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.
The configuration options for that window are forgotten, so that if the
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.
The first two elements of the list are
.QW "\fB\-in \fImaster\fR"
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,
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).
If \fIboolean\fR has a false boolean value then propagation is
disabled for \fImaster\fR.
In either of these cases an empty string is returned.
If \fIboolean\fR is omitted then the command returns \fB0\fR or
\fB1\fR to indicate whether propagation is currently enabled
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
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
a list of row indices to which the configuration options will operate on.
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.
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)
sets the relative weight for apportioning
any extra spaces among
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.
The \fB\-uniform\fR option, when a non-empty value is supplied, places
the row in a \fIuniform group\fR with other rows that have the
same value for \fB\-uniform\fR.  The space for rows belonging to a
uniform group is allocated so that their sizes are always in strict
proportion to their \fB\-weight\fR values.  See
\fBTHE GRID ALGORITHM\fR below for further details.
The \fB\-pad\fR 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.
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 a list of
.QW "-option value"
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.
However, the configuration options for that window are remembered,
so that if the
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.
.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
causes only the slaves in the row (or column) specified by \fIvalue\fR
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,
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,
default values are chosen for
\fBcolumn\fR, \fBrow\fR, \fBcolumnspan\fR and \fBrowspan\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
of the characters \fB\-\fR, \fBx\fR, and \fB^\fR in \fBgrid\fR
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
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
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
.SH "THE GRID ALGORITHM"
.PP
The grid geometry manager lays out its slaves in three steps.
In the first step, the minimum size needed to fit all of the slaves
is computed, then (if propagation is turned on), a request is made
of the master window to become that size.
In the second step, the requested size is compared against the actual size
of the master.  If the sizes are different, then spaces is added to or taken
away from the layout as needed.
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,
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
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
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\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
be exactly twice as large as one that is configured with \fB\-weight 1
\-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
\fIk\fR 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 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
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.
.SH "GEOMETRY PROPAGATION"
.PP
The grid geometry manager normally computes how large a master must be to
just exactly meet the needs of its slaves, and it sets the
requested width and height of the master to these dimensions.
This causes geometry information to propagate up through a
window hierarchy to a top-level window so that the entire
sub-tree sizes itself to fit the needs of the leaf windows.
However, the \fBgrid propagate\fR command may be used to
turn off propagation for one or more masters.
If propagation is disabled then grid will not set
the requested width and height of the master window.
This may be useful if, for example, you wish for a master
window to have a fixed size that you specify.
.SH "RESTRICTIONS ON MASTER WINDOWS"
.PP
The master for each slave must either be the slave's parent
(the default) or a descendant of the slave's parent.
This restriction is necessary to guarantee that the
slave can be placed over any part of its master that is
visible without danger of the slave being clipped by its parent.
In addition, all slaves in one call to \fBgrid\fR must have the same master.
.SH "STACKING ORDER"
.PP
If the master for a slave is not its parent then you must make sure
that the slave is higher in the stacking order than the master.
Otherwise the master will obscure the slave and it will appear as
if the slave has not been managed correctly.
The easiest way to make sure the slave is higher than the master is
to create the master window first:  the most recently created window
will be highest in the stacking order.
.SH CREDITS
.PP
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
text .t.txt \-wrap none \-xscroll {.t.h set} \-yscroll {.t.v set}
scrollbar .t.v \-orient vertical   \-command {.t.txt yview}
scrollbar .t.h \-orient horizontal \-command {.t.txt xview}

# Lay them out
\fBgrid\fR .t.txt .t.v \-sticky nsew
\fBgrid\fR .t.h        \-sticky nsew

# Tell the text widget to take all the extra room
\fBgrid rowconfigure\fR    .t .t.txt \-weight 1
\fBgrid columnconfigure\fR .t .t.txt \-weight 1
.CE
.PP
Three widgets of equal width, despite their different
.QW natural
widths:
.PP
.CS
button .b \-text "Foo"
entry .e \-variable foo
label .l \-text "This is a fairly long piece of text"

\fBgrid\fR .b .e .l \-sticky ew
\fBgrid columnconfigure\fR . "all" \-uniform allTheSame
.CE
.SH "SEE ALSO"
pack(n), place(n)
.SH KEYWORDS
geometry manager, location, grid, cell, propagation, size, pack
'\" Local Variables:
'\" mode: nroff
'\" End:
@


1.22
log
@Fix [Bug 2118116]
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.21 2008/06/30 22:57:02 dkf Exp $
d27 1
d35 1
d41 1
d54 1
d91 1
d103 1
d115 1
d122 1
d128 1
d136 1
d143 1
d152 1
d161 1
d168 1
d176 1
d199 1
d208 1
d217 1
d224 1
d237 1
d274 1
d284 1
d291 1
d315 1
d322 1
d327 1
d422 1
d427 1
a427 1
scrollbar .t.v \-orient vertical   \-command {.t.txt xview}
d429 1
d433 1
d442 1
d447 1
@


1.21
log
@Minor doc updates (removing out of date changebars, improving typedef formatting,
 etc.)
@
text
@a0 1
'\" -*- nroff -*-
d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.20 2007/12/13 15:23:43 dgp Exp $
d424 3
@


1.20
log
@merge stable branch onto HEAD
@
text
@d1 1
d8 1
a8 1
'\" RCS: @@(#) $Id: grid.n,v 1.15.2.1 2007/11/01 16:37:14 dgp Exp $
d30 1
a30 1
starting with \fB.\fR) or one of the characters \fBx\fR or \fB^\fR 
a32 1
.VS 8.5
a37 1
.VE 8.5
d40 1
a40 1
With no arguments, 
d45 1
a45 1
also in pixels.  If a single \fIcolumn\fR and \fIrow\fR is specified on 
d52 1
a52 1
Query or set the column properties of the \fIindex\fR column of the 
d56 1
a56 1
If one or more options are provided, then \fIindex\fR may be given as 
a57 1
.VS 8.5
a61 1
.VE 8.5
d91 1
a91 1
The characters \fB\-\fR,  \fBx\fR and \fB^\fR, 
d201 1
a201 1
Given  \fIx\fR and \fIy\fR values in screen units relative to the master window, 
d219 1
a219 1
Query or set the row properties of the \fIindex\fR row of the 
d223 1
a223 1
If one or more options are provided, then \fIindex\fR may be given as 
a224 1
.VS 8.5
a228 1
.VE 8.5
d266 1
a266 1
row or column, or the largest column or row with a \fBminsize\fR, 
d278 2
a279 2
permit layouts to be created without specifying the row and column 
information for each slave.  This permits slaves to be rearranged, 
d282 1
a282 1
When no column or row information is specified for a \fIslave\fR, 
d337 1
a337 1
a\fR.  A row or column configured with \fB\-weight 2 \-uniform b\fR will 
d339 1
a339 1
\-uniform b\fR.  
a347 1
.VS 8.5
d353 1
a353 1
away from columns and rows according to their weights.  However, once a 
a357 1
.VE 8.5
d395 1
@


1.20.2.1
log
@[Bug 2818455]: Corrected example.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.20 2007/12/13 15:23:43 dgp Exp $
d407 1
a407 1
scrollbar .t.v \-orient vertical   \-command {.t.txt yview}
a408 1

a411 1

a423 1

@


1.19
log
@Minor improvements
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.18 2007/10/29 16:04:13 dkf Exp $
@


1.18
log
@Lots more GOOBE stuff. Now works with 'make html'!
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.17 2007/10/26 20:13:23 dgp Exp $
d105 1
a105 1
call to \fIgrid\fR, or column
@


1.17
log
@        * doc/*.1:              Revert doc changes that broke
        * doc/*.3:              `make html` so we can get the release
        * doc/*.n:              out the door.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.15 2006/11/15 13:29:17 dkf Exp $
a17 1

d56 1
a56 1
and \fB-pad\fR.
d74 1
a74 1
The \fB-uniform\fR option, when a non-empty value is supplied, places
d76 1
a76 1
same value for \fB-uniform\fR.  The space for columns belonging to a
d78 1
a78 1
proportion to their \fB-weight\fR values.  See
d80 1
a80 1
The \fB-pad\fR option specifies the number of screen units that will be
d86 3
a88 1
are returned in a list of "-option value" pairs.
d105 3
a107 1
call to \fIgrid\fR, or column "0" if it is the first slave.  For each
d172 4
a175 2
east, or west) that the slave will "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
d178 3
a180 2
The default is \fB{}\fR, which causes the slave to be centered in its cavity,
at its requested size.
d199 3
a201 2
The first two elements of the list are ``\fB\-in \fImaster\fR'' where
\fImaster\fR is the slave's master.
d206 2
a207 1
For locations that are above or to the left of the grid, \fB-1\fR is returned.
d225 1
a225 1
and \fB-pad\fR.
d243 1
a243 1
The \fB-uniform\fR option, when a non-empty value is supplied, places
d245 1
a245 1
same value for \fB-uniform\fR.  The space for rows belonging to a
d247 1
a247 1
proportion to their \fB-weight\fR values.  See
d249 1
a249 1
The \fB-pad\fR option specifies the number of screen units that will be
d255 3
a257 1
are returned in a list of "-option value" pairs.
d340 5
a344 5
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 
be exactly twice as large as one that is configured with \fB-weight 1
-uniform b\fR.  
d392 1
a392 1
if the slave hasn't been managed correctly.
d417 3
a419 1
Three widgets of equal width, despite their different "natural" widths:
a426 1

a428 1

@


1.16
log
@Lots of improvements to look and feel of manual pages
@
text
@a189 1
.
d193 2
a194 3
The first two elements of the list are
.QW "\fB\-in \fImaster\fR"
where \fImaster\fR is the slave's master.
@


1.15
log
@Convert \fP to \fR so that man-page scrapers have an easier time.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.14 2004/10/29 07:53:15 dkf Exp $
d190 1
d194 3
a196 2
The first two elements of the list are ``\fB\-in \fImaster\fR'' where
\fImaster\fR is the slave's master.
@


1.15.2.1
log
@merge updates from HEAD
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.15 2006/11/15 13:29:17 dkf Exp $
d18 1
d57 1
a57 1
and \fB\-pad\fR.
d75 1
a75 1
The \fB\-uniform\fR option, when a non-empty value is supplied, places
d77 1
a77 1
same value for \fB\-uniform\fR.  The space for columns belonging to a
d79 1
a79 1
proportion to their \fB\-weight\fR values.  See
d81 1
a81 1
The \fB\-pad\fR option specifies the number of screen units that will be
d87 1
a87 3
are returned in a list of
.QW "\-option value"
pairs.
d104 1
a104 3
call to \fBgrid\fR, or column
.QW 0
if it is the first slave.  For each
d169 2
a170 4
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
d173 2
a174 3
The default is
.QW "" ,
which causes the slave to be centered in its cavity, at its requested size.
d193 2
a194 3
The first two elements of the list are
.QW "\fB\-in \fImaster\fR"
where \fImaster\fR is the slave's master.
d199 1
a199 2
For locations that are above or to the left of the grid, \fB\-1\fR is
returned.
d217 1
a217 1
and \fB\-pad\fR.
d235 1
a235 1
The \fB\-uniform\fR option, when a non-empty value is supplied, places
d237 1
a237 1
same value for \fB\-uniform\fR.  The space for rows belonging to a
d239 1
a239 1
proportion to their \fB\-weight\fR values.  See
d241 1
a241 1
The \fB\-pad\fR option specifies the number of screen units that will be
d247 1
a247 3
are returned in a list of
.QW "-option value"
pairs.
d330 5
a334 5
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 
be exactly twice as large as one that is configured with \fB\-weight 1
\-uniform b\fR.  
d382 1
a382 1
if the slave has not been managed correctly.
d407 1
a407 3
Three widgets of equal width, despite their different
.QW natural
widths:
d415 1
d418 1
@


1.14
log
@Minor format fix
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.13 2004/10/28 10:22:51 dkf Exp $
d30 1
a30 1
starting with \fB.\fP) or one of the characters \fBx\fP or \fB^\fP 
d47 1
a47 1
also in pixels.  If a single \fIcolumn\fP and \fIrow\fP is specified on 
d49 1
a49 1
top left cell is numbered from zero.  If both \fIcolumn\fP and \fIrow\fP
d54 5
a58 5
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, \fB\-uniform\fP
and \fB-pad\fP.
If one or more options are provided, then \fIindex\fP may be given as 
d61 1
a61 1
Indices may be integers, window names or the keyword \fIall\fP. For \fIall\fP
d66 1
a66 1
The \fB\-minsize\fP option sets the minimum size, in screen units,
d68 1
a68 1
The \fB\-weight\fP option (an integer value)
d75 3
a77 3
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
d79 1
a79 1
proportion to their \fB-weight\fP values.  See
d81 1
a81 1
The \fB-pad\fP option specifies the number of screen units that will be
d93 1
a93 1
The characters \fB\-\fP,  \fBx\fP and \fB^\fP, 
d95 1
a95 1
location of a \fIslave\fP, as described in the \fBRELATIVE PLACEMENT\fR
d101 1
a101 1
Insert the slave so that it occupies the \fIn\fPth column in the grid.
d104 3
a106 3
call to \fIgrid\fP, or column "0" if it is the first slave.  For each
\fBx\fP that immediately precedes the \fIslave\fP, the column position
is incremented by one.  Thus the \fBx\fP represents a blank column
d110 1
a110 1
Insert the slave so that it occupies \fIn\fP columns in the grid.
d112 2
a113 2
\fB\-\fP, in which case the columnspan is incremented once for each immediately
following \fB\-\fP.
d150 1
a150 1
Insert the slave so that it occupies the \fIn\fPth row in the grid.
d153 1
a153 1
call to \fBgrid\fP, or the first unoccupied row if this is the first slave.
d156 4
a159 4
Insert the slave so that it occupies \fIn\fP rows in the grid.
The default is one row.  If the next \fBgrid\fP command contains
\fB^\fP characters instead of \fIslaves\fP that line up with the columns
of this \fIslave\fP, then the \fBrowspan\fP of this \fIslave\fP is
d166 1
a166 1
\fBn\fP, \fBs\fP, \fBe\fP or \fBw\fP.
d169 5
a173 5
east, or west) that the slave will "stick" to.  If both \fBn\fP and \fBs\fP (or
\fBe\fP and \fBw\fP) are specified, the slave will be stretched to fill the entire
height (or width) of its cavity.  The \fBsticky\fP option subsumes the
combination of \fB\-anchor\fP and \fB\-fill\fP that is used by \fBpack\fP.
The default is \fB{}\fP, which causes the slave to be centered in its cavity,
d197 3
a199 3
Given  \fIx\fP and \fIy\fP values in screen units relative to the master window, 
the column and row number at that \fIx\fP and \fIy\fP location is returned.
For locations that are above or to the left of the grid, \fB-1\fP is returned.
d214 5
a218 5
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, \fB\-uniform\fP
and \fB-pad\fP.
If one or more options are provided, then \fIindex\fP may be given as 
d221 1
a221 1
Indices may be integers, window names or the keyword \fIall\fP. For \fIall\fP
d226 1
a226 1
The \fB\-minsize\fP option sets the minimum size, in screen units,
d228 1
a228 1
The \fB\-weight\fP option (an integer value)
d235 3
a237 3
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
d239 1
a239 1
proportion to their \fB-weight\fP values.  See
d241 1
a241 1
The \fB-pad\fP option specifies the number of screen units that will be
d259 4
a262 4
Returns the size of the grid (in columns then rows) for \fImaster\fP.
The size is determined either by the \fIslave\fP occupying the largest
row or column, or the largest column or row with a \fBminsize\fP, 
\fBweight\fP, or \fBpad\fP that is non-zero.
d267 2
a268 2
\fIOption\fP can be either \fB\-row\fP or \fB\-column\fP which
causes only the slaves in the row (or column) specified by \fIvalue\fP
d272 1
a272 1
The \fBgrid\fP command contains a limited set of capabilities that
d277 1
a277 1
When no column or row information is specified for a \fIslave\fP, 
d279 6
a284 6
\fBcolumn\fP, \fBrow\fP, \fBcolumnspan\fP and \fBrowspan\fP
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, \fBx\fP, and \fB^\fP in \fBgrid\fP
command where \fIslave\fP names are normally expected.
d287 4
a290 4
\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, nor may it be the first \fIslave\fP
d293 8
a300 8
\fBx\fP
This leaves an empty column between the \fIslave\fP on the left and
the \fIslave\fP on the right.
.TP
\fB^\fP
This extends the \fBrowspan\fP of the \fIslave\fP above the \fB^\fP's
in the grid.  The number of \fB^\fP's in a row must match the number of
columns spanned by the \fIslave\fP above it.
d312 1
a312 1
based on the setting of its \fIsticky\fP flag.
d317 1
a317 1
\fIminsize\fP for that row or column, or the sum of the \fIpad\fPding
d323 1
a323 1
row or column in the group according to its \fIweight\fP.  For each
d330 1
a330 1
configured with \fB-weight 1 -uniform a\fP will have exactly the same
d332 1
a332 1
a\fP.  A row or column configured with \fB-weight 2 -uniform b\fR will 
d334 1
a334 1
-uniform b\fP.  
d337 2
a338 2
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
d376 1
a376 1
In addition, all slaves in one call to \fBgrid\fP must have the same master.
d388 1
a388 1
The \fBgrid\fP command is based on ideas taken from the \fIGridBag\fP
@


1.13
log
@Assorted minor documentation fixes
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.12 2004/09/19 16:05:37 dkf Exp $
d403 2
a404 2
\fBgrid rowconfigure\fR    .t .t.txt -weight 1
\fBgrid columnconfigure\fR .t .t.txt -weight 1
@


1.12
log
@Standardize style of section refs & public symbols. Remove displayed tabs
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.11 2004/08/20 10:56:36 dkf Exp $
d37 1
a37 1
when no row/column has any weight.  See ``THE GRID ALGORITHM'' below
d39 1
a39 1
.VE
d65 1
a65 1
.VE
d80 1
a80 1
``THE GRID ALGORITHM'' below for further details.
d204 1
a204 1
name (see ``GEOMETRY PROPAGATION'' below).
d225 1
a225 1
.VE
d240 1
a240 1
``THE GRID ALGORITHM'' below for further details.
d354 1
a354 1
.VE
d403 2
a404 2
\fBgrid\fR rowconfigure    .t .t.txt -weight 1
\fBgrid\fR columnconfigure .t .t.txt -weight 1
d413 1
a413 1
\fBgrid\fR columnconfigure . "all" \-uniform allTheSame
@


1.11
log
@Spelling and grammar fixes from Mikhail Kolesnitchenko. [Patch 1012083]
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.10 2004/06/21 14:41:42 dkf Exp $
d31 1
a31 1
(see the ``RELATIVE PLACEMENT'' section below), then the command is
d95 1
a95 1
location of a \fIslave\fP, as described in the ``RELATIVE PLACEMENT''
@


1.10
log
@Minor update for increased clarity.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.9 2004/06/21 14:40:15 dkf Exp $
d87 1
a87 1
are returned in an list of "-option value" pairs.
d129 1
a129 1
leave on on the top and bottom of the slave(s).
d247 1
a247 1
are returned in an list of "-option value" pairs.
d352 1
a352 1
when all the rows or columns are at there minimum sizes, the layout is
@


1.9
log
@Added examples
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.8 2004/03/04 00:17:07 hobbs Exp $
d400 2
a401 2
grid .t.txt .t.v \-sticky nsew
grid .t.h        \-sticky nsew
d403 2
a404 2
grid rowconfigure    .t .t.txt -weight 1
grid columnconfigure .t .t.txt -weight 1
d407 1
a407 1
Three widgets of equal width:
d412 2
a413 2
grid .b .e .l \-sticky ew
grid columnconfigure . "all" \-uniform allTheSame
@


1.8
log
@minor doc fixes for html conversion
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.7 2004/01/09 22:23:26 pspjuth Exp $
a342 1

a368 1

d391 28
@


1.7
log
@Implementation of TIP#146,
"Add Overall Anchoring to the Grid Geometry Manager",
adding [grid anchor] subcommand.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.6 2003/09/18 18:22:22 pspjuth Exp $
d33 1
a34 1
.VS 8.5
@


1.6
log
@Implementation of TIP#147, "Make Grid's Column/Row Configure Easier".
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.5 2001/09/30 19:01:58 pspjuth Exp $
d34 7
d343 2
d347 2
a348 1
the weights are zero, the layout is centered within its master.
d354 2
a355 1
clipped on the bottom and right.
@


1.5
log
@Added -uniform option to grid's row/columnconfigure.
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.4 2001/08/18 20:03:16 pspjuth Exp $
d10 1
a10 1
.TH grid n 8.4 Tk "Tk Built-In Commands"
a48 1
.VS 8.4
d51 7
a58 2
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.
a67 1
.VS 8.4
a73 1
.VE
a208 1
.VS 8.4
d211 7
a218 2
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.
a227 1
.VS 8.4
a233 1
.VE
@


1.5.4.1
log
@Backport of documentation fixes
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.5 2001/09/30 19:01:58 pspjuth Exp $
d31 1
a31 1
(see the \fBRELATIVE PLACEMENT\fR section below), then the command is
d52 1
a52 1
.VE 8.4
d54 1
a54 1
a list of column indices to which the configuration options will operate on.
d70 2
a71 2
\fBTHE GRID ALGORITHM\fR below for further details.
.VE 8.4
d78 1
a78 1
are returned in a list of "-option value" pairs.
d86 1
a86 1
location of a \fIslave\fP, as described in the \fBRELATIVE PLACEMENT\fR
d120 1
a120 1
leave on the top and bottom of the slave(s).
d195 1
a195 1
name (see \fBGEOMETRY PROPAGATION\fR below).
d210 1
a210 1
.VE 8.4
d212 1
a212 1
a list of row indices to which the configuration options will operate on.
d228 2
a229 2
\fBTHE GRID ALGORITHM\fR below for further details.
.VE 8.4
d236 1
a236 1
are returned in a list of "-option value" pairs.
d339 1
a339 1
when all the rows or columns are at their minimum sizes, the layout is
d355 1
a377 28
.SH EXAMPLES
A toplevel window containing a text widget and two scrollbars:
.CS
# Make the widgets
toplevel .t
text .t.txt \-wrap none \-xscroll {.t.h set} \-yscroll {.t.v set}
scrollbar .t.v \-orient vertical   \-command {.t.txt xview}
scrollbar .t.h \-orient horizontal \-command {.t.txt xview}
# Lay them out
\fBgrid\fR .t.txt .t.v \-sticky nsew
\fBgrid\fR .t.h        \-sticky nsew
# Tell the text widget to take all the extra room
\fBgrid rowconfigure\fR    .t .t.txt -weight 1
\fBgrid columnconfigure\fR .t .t.txt -weight 1
.CE
.PP
Three widgets of equal width, despite their different "natural" widths:
.CS
button .b \-text "Foo"
entry .e \-variable foo
label .l \-text "This is a fairly long piece of text"
\fBgrid\fR .b .e .l \-sticky ew
\fBgrid columnconfigure\fR . {0 1 2} \-uniform allTheSame
.CE

.SH "SEE ALSO"
pack(n), place(n)

@


1.5.4.2
log
@Whoops, missed removing an 8.5 feature from an example when backporting
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.5.4.1 2004/10/28 10:19:29 dkf Exp $
d389 2
a390 2
\fBgrid rowconfigure\fR    .t 0 -weight 1
\fBgrid columnconfigure\fR .t 0 -weight 1
@


1.5.4.3
log
@Minor format fix
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.5.4.2 2004/10/29 07:51:04 dkf Exp $
d389 2
a390 2
\fBgrid rowconfigure\fR    .t 0 \-weight 1
\fBgrid columnconfigure\fR .t 0 \-weight 1
@


1.4
log
@Grid configure rejected	initial "x" and "^". [Bug #418664]
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.3 2001/02/12 18:06:47 drh Exp $
d10 1
a10 1
.TH grid n 4.1 Tk "Tk Built-In Commands"
d49 4
a52 2
The valid options are \fB\-minsize\fP, \fB\-weight\fP and \fB-pad\fP.
.VS
a54 1
.VE
d64 8
d207 4
a210 2
The valid options are \fB\-minsize\fP, \fB\-weight\fP and \fB-pad\fP.
.VS
a212 1
.VE
d222 8
d307 3
a309 2
plus the size of the largest slave, whichever is greater.  Then the
slaves whose rowspans or columnspans are greater than one are
d315 16
@


1.3
log
@Asymmetric padding in "pack" and "grid" geometry managers
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.2 1998/09/14 18:22:56 stanton Exp $
d28 5
a32 3
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.
d254 1
a254 1
of the characters \fB\-\fP, \fB^\fP, and \fB^\fP in \fBgrid\fP
d261 2
a262 1
may not follow a \fB^\fP or a \fBx\fP.
@


1.2
log
@Replaced SCCS strings, fixed binary files
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id$
d116 2
d124 2
@


1.2.20.1
log
@sync with head
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.5 2001/09/30 19:01:58 pspjuth Exp $
d10 1
a10 1
.TH grid n 8.4 Tk "Tk Built-In Commands"
d28 3
a30 5
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.
d47 2
a48 4
.VS 8.4
The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
and \fB-pad\fP.
.VE
d51 1
a60 8
.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
a115 2
\fIAmount\fR may be a list
of two values to specify padding for left and right separately.
a121 2
\fIAmount\fR may be a list
of two values to specify padding for top and bottom separately.
d192 2
a193 4
.VS 8.4
The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
and \fB-pad\fP.
.VE
d196 1
a205 8
.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
d248 1
a248 1
of the characters \fB\-\fP, \fBx\fP, and \fB^\fP in \fBgrid\fP
d255 1
a255 2
may not follow a \fB^\fP or a \fBx\fP, nor may it be the first \fIslave\fP
argument to \fBgrid configure\fR.
d282 2
a283 3
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
a288 16
.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.
@


1.2.18.1
log
@doc cleanup and clarifications from 8.4aCVS backport
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.3 2001/02/12 18:06:47 drh Exp $
a115 2
\fIAmount\fR may be a list
of two values to specify padding for left and right separately.
a121 2
\fIAmount\fR may be a list
of two values to specify padding for top and bottom separately.
@


1.2.18.2
log
@removed erroneous backport of 8.4 feature (asym padding)
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.2.18.1 2001/04/04 07:23:48 hobbs Exp $
d116 2
d124 2
@


1.1
log
@Initial revision
@
text
@d7 1
a7 1
'\" SCCS: @@(#) grid.n 1.15 96/12/13 16:46:35
@


1.1.4.1
log
@Merged 8.0.3 changes into 8.1
@
text
@d7 1
a7 1
'\" RCS: @@(#) $Id: grid.n,v 1.2 1998/09/14 18:22:56 stanton Exp $
@


