Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / man / mann / grid.n
CommitLineData
920dae64
AT
1'\"
2'\" Copyright (c) 1996 Sun Microsystems, Inc.
3'\"
4'\" See the file "license.terms" for information on usage and redistribution
5'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6'\"
7'\" RCS: @(#) $Id: grid.n,v 1.5.4.3 2004/10/29 07:52:08 dkf Exp $
8'\"
9'\" The definitions below are for supplemental macros used in Tcl/Tk
10'\" manual entries.
11'\"
12'\" .AP type name in/out ?indent?
13'\" Start paragraph describing an argument to a library procedure.
14'\" type is type of argument (int, etc.), in/out is either "in", "out",
15'\" or "in/out" to describe whether procedure reads or modifies arg,
16'\" and indent is equivalent to second arg of .IP (shouldn't ever be
17'\" needed; use .AS below instead)
18'\"
19'\" .AS ?type? ?name?
20'\" Give maximum sizes of arguments for setting tab stops. Type and
21'\" name are examples of largest possible arguments that will be passed
22'\" to .AP later. If args are omitted, default tab stops are used.
23'\"
24'\" .BS
25'\" Start box enclosure. From here until next .BE, everything will be
26'\" enclosed in one large box.
27'\"
28'\" .BE
29'\" End of box enclosure.
30'\"
31'\" .CS
32'\" Begin code excerpt.
33'\"
34'\" .CE
35'\" End code excerpt.
36'\"
37'\" .VS ?version? ?br?
38'\" Begin vertical sidebar, for use in marking newly-changed parts
39'\" of man pages. The first argument is ignored and used for recording
40'\" the version when the .VS was added, so that the sidebars can be
41'\" found and removed when they reach a certain age. If another argument
42'\" is present, then a line break is forced before starting the sidebar.
43'\"
44'\" .VE
45'\" End of vertical sidebar.
46'\"
47'\" .DS
48'\" Begin an indented unfilled display.
49'\"
50'\" .DE
51'\" End of indented unfilled display.
52'\"
53'\" .SO
54'\" Start of list of standard options for a Tk widget. The
55'\" options follow on successive lines, in four columns separated
56'\" by tabs.
57'\"
58'\" .SE
59'\" End of list of standard options for a Tk widget.
60'\"
61'\" .OP cmdName dbName dbClass
62'\" Start of description of a specific option. cmdName gives the
63'\" option's name as specified in the class command, dbName gives
64'\" the option's name in the option database, and dbClass gives
65'\" the option's class in the option database.
66'\"
67'\" .UL arg1 arg2
68'\" Print arg1 underlined, then print arg2 normally.
69'\"
70'\" RCS: @(#) $Id: man.macros,v 1.4 2000/08/25 06:18:32 ericm Exp $
71'\"
72'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
73.if t .wh -1.3i ^B
74.nr ^l \n(.l
75.ad b
76'\" # Start an argument description
77.de AP
78.ie !"\\$4"" .TP \\$4
79.el \{\
80. ie !"\\$2"" .TP \\n()Cu
81. el .TP 15
82.\}
83.ta \\n()Au \\n()Bu
84.ie !"\\$3"" \{\
85\&\\$1 \\fI\\$2\\fP (\\$3)
86.\".b
87.\}
88.el \{\
89.br
90.ie !"\\$2"" \{\
91\&\\$1 \\fI\\$2\\fP
92.\}
93.el \{\
94\&\\fI\\$1\\fP
95.\}
96.\}
97..
98'\" # define tabbing values for .AP
99.de AS
100.nr )A 10n
101.if !"\\$1"" .nr )A \\w'\\$1'u+3n
102.nr )B \\n()Au+15n
103.\"
104.if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
105.nr )C \\n()Bu+\\w'(in/out)'u+2n
106..
107.AS Tcl_Interp Tcl_CreateInterp in/out
108'\" # BS - start boxed text
109'\" # ^y = starting y location
110'\" # ^b = 1
111.de BS
112.br
113.mk ^y
114.nr ^b 1u
115.if n .nf
116.if n .ti 0
117.if n \l'\\n(.lu\(ul'
118.if n .fi
119..
120'\" # BE - end boxed text (draw box now)
121.de BE
122.nf
123.ti 0
124.mk ^t
125.ie n \l'\\n(^lu\(ul'
126.el \{\
127.\" Draw four-sided box normally, but don't draw top of
128.\" box if the box started on an earlier page.
129.ie !\\n(^b-1 \{\
130\h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
131.\}
132.el \}\
133\h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
134.\}
135.\}
136.fi
137.br
138.nr ^b 0
139..
140'\" # VS - start vertical sidebar
141'\" # ^Y = starting y location
142'\" # ^v = 1 (for troff; for nroff this doesn't matter)
143.de VS
144.if !"\\$2"" .br
145.mk ^Y
146.ie n 'mc \s12\(br\s0
147.el .nr ^v 1u
148..
149'\" # VE - end of vertical sidebar
150.de VE
151.ie n 'mc
152.el \{\
153.ev 2
154.nf
155.ti 0
156.mk ^t
157\h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
158.sp -1
159.fi
160.ev
161.\}
162.nr ^v 0
163..
164'\" # Special macro to handle page bottom: finish off current
165'\" # box/sidebar if in box/sidebar mode, then invoked standard
166'\" # page bottom macro.
167.de ^B
168.ev 2
169'ti 0
170'nf
171.mk ^t
172.if \\n(^b \{\
173.\" Draw three-sided box if this is the box's first page,
174.\" draw two sides but no top otherwise.
175.ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
176.el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
177.\}
178.if \\n(^v \{\
179.nr ^x \\n(^tu+1v-\\n(^Yu
180\kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
181.\}
182.bp
183'fi
184.ev
185.if \\n(^b \{\
186.mk ^y
187.nr ^b 2
188.\}
189.if \\n(^v \{\
190.mk ^Y
191.\}
192..
193'\" # DS - begin display
194.de DS
195.RS
196.nf
197.sp
198..
199'\" # DE - end display
200.de DE
201.fi
202.RE
203.sp
204..
205'\" # SO - start of list of standard options
206.de SO
207.SH "STANDARD OPTIONS"
208.LP
209.nf
210.ta 5.5c 11c
211.ft B
212..
213'\" # SE - end of list of standard options
214.de SE
215.fi
216.ft R
217.LP
218See the \\fBoptions\\fR manual entry for details on the standard options.
219..
220'\" # OP - start of full description for a single option
221.de OP
222.LP
223.nf
224.ta 4c
225Command-Line Name: \\fB\\$1\\fR
226Database Name: \\fB\\$2\\fR
227Database Class: \\fB\\$3\\fR
228.fi
229.IP
230..
231'\" # CS - begin code excerpt
232.de CS
233.RS
234.nf
235.ta .25i .5i .75i 1i
236..
237'\" # CE - end code excerpt
238.de CE
239.fi
240.RE
241..
242.de UL
243\\$1\l'|0\(ul'\\$2
244..
245.TH grid n 8.4 Tk "Tk Built-In Commands"
246.BS
247'\" Note: do not modify the .SH NAME line immediately below!
248.SH NAME
249grid \- Geometry manager that arranges widgets in a grid
250.SH SYNOPSIS
251\fBgrid \fIoption arg \fR?\fIarg ...\fR?
252.BE
253
254.SH DESCRIPTION
255.PP
256The \fBgrid\fR command is used to communicate with the grid
257geometry manager that arranges widgets in rows and columns inside
258of another window, called the geometry master (or master window).
259The \fBgrid\fR command can have any of several forms, depending
260on the \fIoption\fR argument:
261.TP
262\fBgrid \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR?
263If the first argument to \fBgrid\fR is suitable as the first slave
264argument to \fBgrid configure\fR, either a window name (any value
265starting with \fB.\fP) or one of the characters \fBx\fP or \fB^\fP
266(see the \fBRELATIVE PLACEMENT\fR section below), then the command is
267processed in the same way as \fBgrid configure\fR.
268.TP
269\fBgrid bbox \fImaster\fR ?\fIcolumn row\fR? ?\fIcolumn2 row2\fR?
270With no arguments,
271the bounding box (in pixels) of the grid is returned.
272The return value consists of 4 integers. The first two are the pixel
273offset from the master window (x then y) of the top-left corner of the
274grid, and the second two integers are the width and height of the grid,
275also in pixels. If a single \fIcolumn\fP and \fIrow\fP is specified on
276the command line, then the bounding box for that cell is returned, where the
277top left cell is numbered from zero. If both \fIcolumn\fP and \fIrow\fP
278arguments are specified, then the bounding box spanning the rows and columns
279indicated is returned.
280.TP
281\fBgrid columnconfigure \fImaster index \fR?\fI\-option value...\fR?
282Query or set the column properties of the \fIindex\fP column of the
283geometry master, \fImaster\fP.
284.VS 8.4
285The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
286and \fB-pad\fP.
287.VE 8.4
288If one or more options are provided, then \fIindex\fP may be given as
289a list of column indices to which the configuration options will operate on.
290The \fB\-minsize\fP option sets the minimum size, in screen units,
291that will be permitted for this column.
292The \fB\-weight\fP option (an integer value)
293sets the relative weight for apportioning
294any extra spaces among
295columns.
296A weight of zero (0) indicates the column will not deviate from its requested
297size. A column whose weight is two will grow at twice the rate as a column
298of weight one when extra space is allocated to the layout.
299.VS 8.4
300The \fB-uniform\fP option, when a non-empty value is supplied, places
301the column in a \fIuniform group\fP with other columns that have the
302same value for \fB-uniform\fP. The space for columns belonging to a
303uniform group is allocated so that their sizes are always in strict
304proportion to their \fB-weight\fP values. See
305\fBTHE GRID ALGORITHM\fR below for further details.
306.VE 8.4
307The \fB-pad\fP option specifies the number of screen units that will be
308added to the largest window contained completely in that column when the
309grid geometry manager requests a size from the containing window.
310If only an option is specified, with no value,
311the current value of that option is returned.
312If only the master window and index is specified, all the current settings
313are returned in a list of "-option value" pairs.
314.TP
315\fBgrid configure \fIslave \fR?\fIslave ...\fR? ?\fIoptions\fR?
316The arguments consist of the names of one or more slave windows
317followed by pairs of arguments that specify how
318to manage the slaves.
319The characters \fB\-\fP, \fBx\fP and \fB^\fP,
320can be specified instead of a window name to alter the default
321location of a \fIslave\fP, as described in the \fBRELATIVE PLACEMENT\fR
322section, below.
323The following options are supported:
324.RS
325.TP
326\fB\-column \fIn\fR
327Insert the slave so that it occupies the \fIn\fPth column in the grid.
328Column numbers start with 0. If this option is not supplied, then the
329slave is arranged just to the right of previous slave specified on this
330call to \fIgrid\fP, or column "0" if it is the first slave. For each
331\fBx\fP that immediately precedes the \fIslave\fP, the column position
332is incremented by one. Thus the \fBx\fP represents a blank column
333for this row in the grid.
334.TP
335\fB\-columnspan \fIn\fR
336Insert the slave so that it occupies \fIn\fP columns in the grid.
337The default is one column, unless the window name is followed by a
338\fB\-\fP, in which case the columnspan is incremented once for each immediately
339following \fB\-\fP.
340.TP
341\fB\-in \fIother\fR
342Insert the slave(s) in the master
343window given by \fIother\fR. The default is the first slave's
344parent window.
345.TP
346\fB\-ipadx \fIamount\fR
347The \fIamount\fR specifies how much horizontal internal padding to
348leave on each side of the slave(s). This is space is added
349inside the slave(s) border.
350The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB.5c\fR.
351It defaults to 0.
352.TP
353\fB\-ipady \fIamount\fR
354The \fIamount\fR specifies how much vertical internal padding to
355leave on the top and bottom of the slave(s).
356This space is added inside the slave(s) border.
357The \fIamount\fR defaults to 0.
358.TP
359\fB\-padx \fIamount\fR
360The \fIamount\fR specifies how much horizontal external padding to
361leave on each side of the slave(s), in screen units.
362\fIAmount\fR may be a list
363of two values to specify padding for left and right separately.
364The \fIamount\fR defaults to 0.
365This space is added outside the slave(s) border.
366.TP
367\fB\-pady \fIamount\fR
368The \fIamount\fR specifies how much vertical external padding to
369leave on the top and bottom of the slave(s), in screen units.
370\fIAmount\fR may be a list
371of two values to specify padding for top and bottom separately.
372The \fIamount\fR defaults to 0.
373This space is added outside the slave(s) border.
374.TP
375\fB\-row \fIn\fR
376Insert the slave so that it occupies the \fIn\fPth row in the grid.
377Row numbers start with 0. If this option is not supplied, then the
378slave is arranged on the same row as the previous slave specified on this
379call to \fBgrid\fP, or the first unoccupied row if this is the first slave.
380.TP
381\fB\-rowspan \fIn\fR
382Insert the slave so that it occupies \fIn\fP rows in the grid.
383The default is one row. If the next \fBgrid\fP command contains
384\fB^\fP characters instead of \fIslaves\fP that line up with the columns
385of this \fIslave\fP, then the \fBrowspan\fP of this \fIslave\fP is
386extended by one.
387.TP
388\fB\-sticky \fIstyle\fR
389If a slave's cell is larger than its requested dimensions, this
390option may be used to position (or stretch) the slave within its cell.
391\fIStyle\fR is a string that contains zero or more of the characters
392\fBn\fP, \fBs\fP, \fBe\fP or \fBw\fP.
393The string can optionally contains spaces or
394commas, but they are ignored. Each letter refers to a side (north, south,
395east, or west) that the slave will "stick" to. If both \fBn\fP and \fBs\fP (or
396\fBe\fP and \fBw\fP) are specified, the slave will be stretched to fill the entire
397height (or width) of its cavity. The \fBsticky\fP option subsumes the
398combination of \fB\-anchor\fP and \fB\-fill\fP that is used by \fBpack\fP.
399The default is \fB{}\fP, which causes the slave to be centered in its cavity,
400at its requested size.
401.LP
402If any of the slaves are already managed by the geometry manager
403then any unspecified options for them retain their previous values rather
404than receiving default values.
405.RE
406.TP
407\fBgrid forget \fIslave \fR?\fIslave ...\fR?
408Removes each of the \fIslave\fRs from grid for its
409master and unmaps their windows.
410The slaves will no longer be managed by the grid geometry manager.
411The configuration options for that window are forgotten, so that if the
412slave is managed once more by the grid geometry manager, the initial
413default settings are used.
414.TP
415\fBgrid info \fIslave\fR
416Returns a list whose elements are the current configuration state of
417the slave given by \fIslave\fR in the same option-value form that
418might be specified to \fBgrid configure\fR.
419The first two elements of the list are ``\fB\-in \fImaster\fR'' where
420\fImaster\fR is the slave's master.
421.TP
422\fBgrid location \fImaster x y\fR
423Given \fIx\fP and \fIy\fP values in screen units relative to the master window,
424the column and row number at that \fIx\fP and \fIy\fP location is returned.
425For locations that are above or to the left of the grid, \fB-1\fP is returned.
426.TP
427\fBgrid propagate \fImaster\fR ?\fIboolean\fR?
428If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR
429then propagation is enabled for \fImaster\fR, which must be a window
430name (see \fBGEOMETRY PROPAGATION\fR below).
431If \fIboolean\fR has a false boolean value then propagation is
432disabled for \fImaster\fR.
433In either of these cases an empty string is returned.
434If \fIboolean\fR is omitted then the command returns \fB0\fR or
435\fB1\fR to indicate whether propagation is currently enabled
436for \fImaster\fR.
437Propagation is enabled by default.
438.TP
439\fBgrid rowconfigure \fImaster index \fR?\fI\-option value...\fR?
440Query or set the row properties of the \fIindex\fP row of the
441geometry master, \fImaster\fP.
442.VS 8.4
443The valid options are \fB\-minsize\fP, \fB\-weight\fP, \fB\-uniform\fP
444and \fB-pad\fP.
445.VE 8.4
446If one or more options are provided, then \fIindex\fP may be given as
447a list of row indices to which the configuration options will operate on.
448The \fB\-minsize\fP option sets the minimum size, in screen units,
449that will be permitted for this row.
450The \fB\-weight\fP option (an integer value)
451sets the relative weight for apportioning
452any extra spaces among
453rows.
454A weight of zero (0) indicates the row will not deviate from its requested
455size. A row whose weight is two will grow at twice the rate as a row
456of weight one when extra space is allocated to the layout.
457.VS 8.4
458The \fB-uniform\fP option, when a non-empty value is supplied, places
459the row in a \fIuniform group\fP with other rows that have the
460same value for \fB-uniform\fP. The space for rows belonging to a
461uniform group is allocated so that their sizes are always in strict
462proportion to their \fB-weight\fP values. See
463\fBTHE GRID ALGORITHM\fR below for further details.
464.VE 8.4
465The \fB-pad\fP option specifies the number of screen units that will be
466added to the largest window contained completely in that row when the
467grid geometry manager requests a size from the containing window.
468If only an option is specified, with no value,
469the current value of that option is returned.
470If only the master window and index is specified, all the current settings
471are returned in a list of "-option value" pairs.
472.TP
473\fBgrid remove \fIslave \fR?\fIslave ...\fR?
474Removes each of the \fIslave\fRs from grid for its
475master and unmaps their windows.
476The slaves will no longer be managed by the grid geometry manager.
477However, the configuration options for that window are remembered,
478so that if the
479slave is managed once more by the grid geometry manager, the previous
480values are retained.
481.TP
482\fBgrid size \fImaster\fR
483Returns the size of the grid (in columns then rows) for \fImaster\fP.
484The size is determined either by the \fIslave\fP occupying the largest
485row or column, or the largest column or row with a \fBminsize\fP,
486\fBweight\fP, or \fBpad\fP that is non-zero.
487.TP
488\fBgrid slaves \fImaster\fR ?\fI\-option value\fR?
489If no options are supplied, a list of all of the slaves in \fImaster\fR
490are returned, most recently manages first.
491\fIOption\fP can be either \fB\-row\fP or \fB\-column\fP which
492causes only the slaves in the row (or column) specified by \fIvalue\fP
493to be returned.
494.SH "RELATIVE PLACEMENT"
495.PP
496The \fBgrid\fP command contains a limited set of capabilities that
497permit layouts to be created without specifying the row and column
498information for each slave. This permits slaves to be rearranged,
499added, or removed without the need to explicitly specify row and
500column information.
501When no column or row information is specified for a \fIslave\fP,
502default values are chosen for
503\fBcolumn\fP, \fBrow\fP, \fBcolumnspan\fP and \fBrowspan\fP
504at the time the \fIslave\fP is managed. The values are chosen
505based upon the current layout of the grid, the position of the \fIslave\fP
506relative to other \fIslave\fPs in the same grid command, and the presence
507of the characters \fB\-\fP, \fBx\fP, and \fB^\fP in \fBgrid\fP
508command where \fIslave\fP names are normally expected.
509.RS
510.TP
511\fB\-\fP
512This increases the columnspan of the \fIslave\fP to the left. Several
513\fB\-\fP's in a row will successively increase the columnspan. A \fB\-\fP
514may not follow a \fB^\fP or a \fBx\fP, nor may it be the first \fIslave\fP
515argument to \fBgrid configure\fR.
516.TP
517\fBx\fP
518This leaves an empty column between the \fIslave\fP on the left and
519the \fIslave\fP on the right.
520.TP
521\fB^\fP
522This extends the \fBrowspan\fP of the \fIslave\fP above the \fB^\fP's
523in the grid. The number of \fB^\fP's in a row must match the number of
524columns spanned by the \fIslave\fP above it.
525.RE
526.SH "THE GRID ALGORITHM"
527.PP
528The grid geometry manager lays out its slaves in three steps.
529In the first step, the minimum size needed to fit all of the slaves
530is computed, then (if propagation is turned on), a request is made
531of the master window to become that size.
532In the second step, the requested size is compared against the actual size
533of the master. If the sizes are different, then spaces is added to or taken
534away from the layout as needed.
535For the final step, each slave is positioned in its row(s) and column(s)
536based on the setting of its \fIsticky\fP flag.
537.PP
538To compute the minimum size of a layout, the grid geometry manager
539first looks at all slaves whose columnspan and rowspan values are one,
540and computes the nominal size of each row or column to be either the
541\fIminsize\fP for that row or column, or the sum of the \fIpad\fPding
542plus the size of the largest slave, whichever is greater. After that
543the rows or columns in each uniform group adapt to each other. Then
544the slaves whose rowspans or columnspans are greater than one are
545examined. If a group of rows or columns need to be increased in size
546in order to accommodate these slaves, then extra space is added to each
547row or column in the group according to its \fIweight\fP. For each
548group whose weights are all zero, the additional space is apportioned
549equally.
550.PP
551When multiple rows or columns belong to a uniform group, the space
552allocated to them is always in proportion to their weights. (A weight
553of zero is considered to be 1.) In other words, a row or column
554configured with \fB-weight 1 -uniform a\fP will have exactly the same
555size as any other row or column configured with \fB-weight 1 -uniform
556a\fP. A row or column configured with \fB-weight 2 -uniform b\fR will
557be exactly twice as large as one that is configured with \fB-weight 1
558-uniform b\fP.
559.PP
560More technically, each row or column in the group will have a size
561equal to \fIk*weight\fP for some constant \fIk\fP. The constant
562\fIk\fP is chosen so that no row or column becomes smaller than its
563minimum size. For example, if all rows or columns in a group have the
564same weight, then each row or column will have the same size as the
565largest row or column in the group.
566.PP
567For masters whose size is larger than the requested layout, the additional
568space is apportioned according to the row and column weights. If all of
569the weights are zero, the layout is centered within its master.
570For masters whose size is smaller than the requested layout, space is taken
571away from columns and rows according to their weights. However, once a
572column or row shrinks to its minsize, its weight is taken to be zero.
573If more space needs to be removed from a layout than would be permitted, as
574when all the rows or columns are at their minimum sizes, the layout is
575clipped on the bottom and right.
576.SH "GEOMETRY PROPAGATION"
577.PP
578The grid geometry manager normally computes how large a master must be to
579just exactly meet the needs of its slaves, and it sets the
580requested width and height of the master to these dimensions.
581This causes geometry information to propagate up through a
582window hierarchy to a top-level window so that the entire
583sub-tree sizes itself to fit the needs of the leaf windows.
584However, the \fBgrid propagate\fR command may be used to
585turn off propagation for one or more masters.
586If propagation is disabled then grid will not set
587the requested width and height of the master window.
588This may be useful if, for example, you wish for a master
589window to have a fixed size that you specify.
590.SH "RESTRICTIONS ON MASTER WINDOWS"
591.PP
592The master for each slave must either be the slave's parent
593(the default) or a descendant of the slave's parent.
594This restriction is necessary to guarantee that the
595slave can be placed over any part of its master that is
596visible without danger of the slave being clipped by its parent.
597In addition, all slaves in one call to \fBgrid\fP must have the same master.
598.SH "STACKING ORDER"
599.PP
600If the master for a slave is not its parent then you must make sure
601that the slave is higher in the stacking order than the master.
602Otherwise the master will obscure the slave and it will appear as
603if the slave hasn't been managed correctly.
604The easiest way to make sure the slave is higher than the master is
605to create the master window first: the most recently created window
606will be highest in the stacking order.
607.SH CREDITS
608.PP
609The \fBgrid\fP command is based on ideas taken from the \fIGridBag\fP
610geometry manager written by Doug. Stein, and the \fBblt_table\fR geometry
611manager, written by George Howlett.
612.SH EXAMPLES
613A toplevel window containing a text widget and two scrollbars:
614.CS
615# Make the widgets
616toplevel .t
617text .t.txt \-wrap none \-xscroll {.t.h set} \-yscroll {.t.v set}
618scrollbar .t.v \-orient vertical \-command {.t.txt xview}
619scrollbar .t.h \-orient horizontal \-command {.t.txt xview}
620# Lay them out
621\fBgrid\fR .t.txt .t.v \-sticky nsew
622\fBgrid\fR .t.h \-sticky nsew
623# Tell the text widget to take all the extra room
624\fBgrid rowconfigure\fR .t 0 \-weight 1
625\fBgrid columnconfigure\fR .t 0 \-weight 1
626.CE
627.PP
628Three widgets of equal width, despite their different "natural" widths:
629.CS
630button .b \-text "Foo"
631entry .e \-variable foo
632label .l \-text "This is a fairly long piece of text"
633\fBgrid\fR .b .e .l \-sticky ew
634\fBgrid columnconfigure\fR . {0 1 2} \-uniform allTheSame
635.CE
636
637.SH "SEE ALSO"
638pack(n), place(n)
639
640.SH KEYWORDS
641geometry manager, location, grid, cell, propagation, size, pack