summaryrefslogtreecommitdiffstats
path: root/doc/grid.n
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-04 12:38:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-04 12:38:37 (GMT)
commit7fbdc22e15b48b888546a5df320f8d7ffedb78b1 (patch)
tree838814268df1612366f505acc1876e1ca9e22bf5 /doc/grid.n
parent83284028be79738bc82ba21dd3f02fe2effb46ee (diff)
downloadtk-7fbdc22e15b48b888546a5df320f8d7ffedb78b1.zip
tk-7fbdc22e15b48b888546a5df320f8d7ffedb78b1.tar.gz
tk-7fbdc22e15b48b888546a5df320f8d7ffedb78b1.tar.bz2
TIP #581: grid/pack/place implementation (internal) and documentation
Diffstat (limited to 'doc/grid.n')
-rw-r--r--doc/grid.n202
1 files changed, 104 insertions, 98 deletions
diff --git a/doc/grid.n b/doc/grid.n
index da48e66..c56ebfd 100644
--- a/doc/grid.n
+++ b/doc/grid.n
@@ -57,9 +57,9 @@ 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 options apply to all columns currently occupied be content windows. For
+a window name, that window must be a content of this container and the options
+apply to all columns currently occupied be the content.
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)
@@ -80,137 +80,137 @@ 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
+If only the container 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?
+\fBgrid configure \fIwindow \fR?\fIwindow ...\fR? ?\fIoptions\fR?
.
-The arguments consist of the names of one or more slave windows
+The arguments consist of the names of one or more content windows
followed by pairs of arguments that specify how
-to manage the slaves.
+to manage the content.
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
+location of a \fIwindow\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.
+Insert the window 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
+window is arranged just to the right of previous window 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
+if it is the first window. For each
+\fBx\fR that immediately precedes the \fIwindow\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.
+Insert the window 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
+\fB\-in \fIcontainer\fR
.
-Insert the slave(s) in the master
-window given by \fIother\fR. The default is the first slave's
+Insert the window(s) in the container
+window given by \fIcontainer\fR. The default is the first window'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.
+leave on each side of the content. This is space is added
+inside the content 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.
+leave on the top and bottom of the content.
+This space is added inside the content 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.
+leave on each side of the content, 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.
+This space is added outside the content 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.
+leave on the top and bottom of the content, 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.
+This space is added outside the content border.
.TP
\fB\-row \fIn\fR
.
-Insert the slave so that it occupies the \fIn\fRth row in the grid.
+Insert the content 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
+content is arranged on the same row as the previous content specified on this
call to \fBgrid\fR, or the next row after the highest occupied row
-if this is the first slave.
+if this is the first content.
.TP
\fB\-rowspan \fIn\fR
.
-Insert the slave so that it occupies \fIn\fR rows in the grid.
+Insert the content 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
+\fB^\fR characters instead of \fIcontent\fR that line up with the columns
+of this \fIcontent\fR, then the \fBrowspan\fR of this \fIcontent\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.
+If a content's cell is larger than its requested dimensions, this
+option may be used to position (or stretch) the content 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
+east, or west) that the content 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
+specified, the content will be stretched to fill the entire
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 "" ,
-which causes the slave to be centered in its cavity, at its requested size.
+which causes the content to be centered in its cavity, at its requested size.
.LP
-If any of the slaves are already managed by the geometry manager
+If any of the content is 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?
+\fBgrid forget \fIwindow \fR?\fIwindow ...\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.
+Removes each of the \fIwindow\fRs from grid for its
+container and unmaps their windows.
+The content 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
+window is managed once more by the grid geometry manager, the initial
default settings are used.
.TP
-\fBgrid info \fIslave\fR
+\fBgrid info \fIwindow\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
+the content given by \fIwindow\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 \fIother\fR"
-where \fIother\fR is the windows's container window.
+.QW "\fB\-in \fIcontainer\fR"
+where \fIcontainer\fR is the windows's container window.
.TP
\fBgrid location \fIwindow x y\fR
.
@@ -264,91 +264,97 @@ 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
+If only the container 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?
+\fBgrid remove \fIwindow \fR?\fIwindow ...\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.
+Removes each of the \fIwindow\fRs from grid for its
+container and unmaps their windows.
+The content 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
+\fBgrid size \fIcontainer\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
+Returns the size of the grid (in columns then rows) for \fIcontainer\fR.
+The size is determined either by the \fIcontent\fR occupying the largest
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?
+\fBgrid slaves \window\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.
+If no options are supplied, a list of all of the content in \window\fR
+are returned, most recently managed 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
+causes only the content in the row (or column) specified by \fIvalue\fR
to be returned.
+.TP
+.VS "TIP 581"
+\fBgrid content \fIwindow\fR ?\fI\-option value\fR?
+.
+Synonym for . \fBgrid slaves \fIwindow\fR ?\fI\-option value\fR?
+.VE "TIP 581"
.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,
+information for each content. This permits content 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 \fIcontent\fR,
default values are chosen for
\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
+at the time the \fIcontent\fR is managed. The values are chosen
+based upon the current layout of the grid, the position of the \fIcontent\fR
+relative to other \fIcontent\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.
+command where \fIcontent\fR names are normally expected.
.RS
.TP
\fB\-\fR
.
-This increases the \fB\-columnspan\fR of the \fIslave\fR to the left. Several
+This increases the \fB\-columnspan\fR of the \fIcontent\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
+may not follow a \fB^\fR or a \fBx\fR, nor may it be the first \fIcontent\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.
+This leaves an empty column between the \fIcontent\fR on the left and
+the \fIcontent\fR on the right.
.TP
\fB^\fR
.
-This extends the \fB\-rowspan\fR of the \fIslave\fR above the \fB^\fR's
+This extends the \fB\-rowspan\fR of the \fIcontent\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.
+columns spanned by the \fIcontent\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
+The grid geometry manager lays out its content in three steps.
+In the first step, the minimum size needed to fit all of the content
is computed, then (if propagation is turned on), a request is made
-of the master window to become that size.
+of the container 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
+of the container. 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)
+For the final step, each content 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 \fB\-columnspan\fR and \fB\-rowspan\fR values are one,
+first looks at all content 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
+plus the size of the largest content, whichever is greater. After that
the rows or columns in each uniform group adapt to each other. Then
-the slaves whose row-spans or column-spans are greater than one are
+the content 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
+in order to accommodate these content, 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.
@@ -369,11 +375,11 @@ 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
+For containers 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 weights are zero, the layout is placed within its container according to
the \fIanchor\fR value.
-For masters whose size is smaller than the requested layout, space is taken
+For containers 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
@@ -381,34 +387,34 @@ 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.
+The grid geometry manager normally computes how large a container must be to
+just exactly meet the needs of its content, and it sets the
+requested width and height of the container 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.
+turn off propagation for one or more containers.
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
+the requested width and height of the container window.
+This may be useful if, for example, you wish for a container
window to have a fixed size that you specify.
.SH "RESTRICTIONS ON CONTAINER WINDOWS"
.PP
-The master for each slave must either be the slave's parent
-(the default) or a descendant of the slave's parent.
+The container for each content must either be the content's parent
+(the default) or a descendant of the content'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.
+content can be placed over any part of its container that is
+visible without danger of the content being clipped by its parent.
+In addition, all content in one call to \fBgrid\fR must have the same container.
.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
+If the container for a content is not its parent then you must make sure
+that the content is higher in the stacking order than the container.
+Otherwise the container will obscure the content and it will appear as
+if the content has not been managed correctly.
+The easiest way to make sure the content is higher than the container is
+to create the container window first: the most recently created window
will be highest in the stacking order.
.SH CREDITS
.PP