Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man3 / Tk::grid.3
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "GRID 1"
132.TH GRID 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation"
133.SH "NAME"
134Tk::grid \- Geometry manager that arranges widgets in a grid
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137\&\ \fI$widget\fR\->\fBgrid\fR?(?\fIwidget\fR ...,? ?\fIarg\fR ?...>?)?
138.PP
139\&\ \fI$widget\fR\->\fBgrid\fR\fIOption\fR?(\fIarg\fR ?,\fIarg\fR ...?)?
140.SH "DESCRIPTION"
141.IX Header "DESCRIPTION"
142The \fBgrid\fR method is used to communicate with the grid
143geometry manager that arranges widgets in rows and columns inside
144of another window, called the geometry master (or master window).
145The \fBgrid\fR method can have any of several forms, depending
146on the \fIoption\fR argument:
147.IP "\fI$slave\fR\->\fBgrid\fR(?\fI$slave, ...\fR??, \fIoptions\fR?)" 4
148.IX Item "$slave->grid(?$slave, ...??, options?)"
149The arguments consist of the optional references to more slave windows
150followed by pairs of arguments that specify how to manage the slaves.
151The characters \fB\-\fR, \fBx\fR and \fB^\fR,
152can be specified instead of a window reference to alter the default
153location of a \fI$slave\fR, as described in \*(L"\s-1RELATIVE\s0 \s-1PLACEMENT\s0\*(R", below.
154.Sp
155If any of the slaves are already managed by the geometry manager
156then any unspecified options for them retain their previous values rather
157than receiving default values.
158.Sp
159The following options are supported:
160.RS 4
161.IP "\fB\-column\fR => \fIn\fR" 8
162.IX Item "-column => n"
163Insert the \fI$slave\fR so that it occupies the \fIn\fRth column in the grid.
164Column numbers start with 0. If this option is not supplied, then the
165\&\fI$slave\fR is arranged just to the right of previous slave specified on this
166call to \fBgrid\fR, or column \*(L"0\*(R" if it is the first slave. For each
167\&\fBx\fR that immediately precedes the \fI$slave\fR, the column position
168is incremented by one. Thus the \fBx\fR represents a blank column
169for this row in the grid.
170.IP "\fB\-columnspan\fR => \fIn\fR" 8
171.IX Item "-columnspan => n"
172Insert the slave so that it occupies \fIn\fR columns in the grid.
173The default is one column, unless the window name is followed by a
174\&\fB\-\fR, in which case the columnspan is incremented once for each immediately
175following \fB\-\fR.
176.IP "\fB\-in\fR => \fI$other\fR" 8
177.IX Item "-in => $other"
178Insert the slave(s) in the master
179window given by \fI$other\fR. The default is the first slave's
180parent window.
181.IP "\fB\-ipadx\fR => \fIamount\fR" 8
182.IX Item "-ipadx => amount"
183The \fIamount\fR specifies how much horizontal internal padding to
184leave on each side of the slave(s). This is space is added
185inside the slave(s) border.
186The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB'.5c'\fR.
187It defaults to 0.
188.IP "\fB\-ipady\fR => \fIamount\fR" 8
189.IX Item "-ipady => amount"
190The \fIamount\fR specifies how much vertical internal padding to
191leave on on the top and bottom of the slave(s).
192This space is added inside the slave(s) border.
193The \fIamount\fR defaults to 0.
194.IP "\fB\-padx\fR => \fIamount\fR" 8
195.IX Item "-padx => amount"
196The \fIamount\fR specifies how much horizontal external padding to
197leave on each side of the slave(s), in screen units.
198The \fIamount\fR defaults to 0.
199This space is added outside the slave(s) border.
200.IP "\fB\-pady\fR => \fIamount\fR" 8
201.IX Item "-pady => amount"
202The \fIamount\fR specifies how much vertical external padding to
203leave on the top and bottom of the slave(s), in screen units.
204The \fIamount\fR defaults to 0.
205This space is added outside the slave(s) border.
206.IP "\fB\-row\fR => \fIn\fR" 8
207.IX Item "-row => n"
208Insert the slave so that it occupies the \fIn\fRth row in the grid.
209Row numbers start with 0. If this option is not supplied, then the
210slave is arranged on the same row as the previous slave specified on this
211call to \fBgrid\fR, or the first unoccupied row if this is the first slave.
212.IP "\fB\-rowspan\fR => \fIn\fR" 8
213.IX Item "-rowspan => n"
214Insert the slave so that it occupies \fIn\fR rows in the grid.
215The default is one row. If the next \fBgrid\fR method contains
216\&\fB^\fR characters instead of \fI$slave\fRs that line up with the columns
217of this \fI$slave\fR, then the \fBrowspan\fR of this \fI$slave\fR is
218extended by one.
219.IP "\fB\-sticky\fR => \fIstyle\fR" 8
220.IX Item "-sticky => style"
221If a slave's cell is larger than its requested dimensions, this
222option may be used to position (or stretch) the slave within its cell.
223\&\fIStyle\fR is a string that contains zero or more of the characters
224\&\fBn\fR, \fBs\fR, \fBe\fR or \fBw\fR.
225The string can optionally contain spaces or
226commas, but they are ignored. Each letter refers to a side (north, south,
227east, or west) that the slave will \*(L"stick\*(R" to. If both \fBn\fR and \fBs\fR (or
228\&\fBe\fR and \fBw\fR) are specified, the slave will be stretched to fill the entire
229height (or width) of its cavity. The \fBsticky\fR option subsumes the
230combination of \fB\-anchor\fR and \fB\-fill\fR that is used by pack.
231The default is \fB''\fR, which causes the slave to be centered in its cavity,
232at its requested size.
233.RE
234.RS 4
235.RE
236.IP "\fI$master\fR\->\fBgridBbox\fR(?\fIcolumn, row\fR,? ?\fIcolumn2, row2\fR?)" 4
237.IX Item "$master->gridBbox(?column, row,? ?column2, row2?)"
238With no arguments,
239the bounding box (in pixels) of the grid is returned.
240The return value consists of 4 integers. The first two are the pixel
241offset from the master window (x then y) of the top-left corner of the
242grid, and the second two integers are the width and height of the grid,
243also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on
244the command line, then the bounding box for that cell is returned, where the
245top left cell is numbered from zero. If both \fIcolumn\fR and \fIrow\fR
246arguments are specified, then the bounding box spanning the rows and columns
247indicated is returned.
248.IP "\fI$master\fR\->\fBgridColumnconfigure\fR(\fIindex\fR?, \fI\-option\fR=>\fIvalue, ...\fR?)" 4
249.IX Item "$master->gridColumnconfigure(index?, -option=>value, ...?)"
250Query or set the column properties of the \fIindex\fR column of the
251geometry master, \fI$master\fR.
252The valid options are \fB\-minsize\fR, \fB\-weight\fR and \fB\-pad\fR.
253If one or more options are provided, then \fIindex\fR may be given as
254a list of column indices to which the configuration options will operate on.
255The \fB\-minsize\fR option sets the minimum size, in screen units,
256that will be permitted for this column.
257The \fB\-weight\fR option (an integer value)
258sets the relative weight for apportioning
259any extra spaces among
260columns.
261A weight of zero (0) indicates the column will not deviate from its requested
262size. A column whose weight is two will grow at twice the rate as a column
263of weight one when extra space is allocated to the layout.
264The \fB\-pad\fR option specifies the number of screen units that will be
265added to the largest window contained completely in that column when the
266grid geometry manager requests a size from the containing window.
267If only an option is specified, with no value,
268the current value of that option is returned.
269If only the master window and index is specified, all the current settings
270are returned in an list of \*(L"\-option value\*(R" pairs.
271.IP "\fI$slave\fR\->\fBgridConfigure\fR(?\fI$slave, ...\fR?, \fIoptions\fR?)" 4
272.IX Item "$slave->gridConfigure(?$slave, ...?, options?)"
273The same as \fBgrid\fR method.
274.IP "\fI$slave\fR\->\fBgridForget\fR?(\fI$slave, ...\fR)?" 4
275.IX Item "$slave->gridForget?($slave, ...)?"
276Removes each of the \fI$slave\fRs from grid for its
277master and unmaps their windows.
278The slaves will no longer be managed by the grid geometry manager.
279The configuration options for that window are forgotten, so that if the
280slave is managed once more by the grid geometry manager, the initial
281default settings are used.
282.IP "\fI$slave\fR\->\fBgridInfo\fR" 4
283.IX Item "$slave->gridInfo"
284Returns a list whose elements are the current configuration state of
285the slave given by \fI$slave\fR in the same option-value form that
286might be specified to \fBgridConfigure\fR.
287The first two elements of the list are ``\fB\-in\fR=>\fI$master\fR'' where
288\&\fI$master\fR is the slave's master.
289.IP "\fI$master\fR\->\fBgridLocation\fR(\fIx, y\fR)" 4
290.IX Item "$master->gridLocation(x, y)"
291Given \fIx\fR and \fIy\fR values in screen units relative to the master window,
292the column and row number at that \fIx\fR and \fIy\fR location is returned.
293For locations that are above or to the left of the grid, \fB\-1\fR is returned.
294.IP "\fI$master\fR\->\fBgridPropagate\fR?(\fIboolean\fR)?" 4
295.IX Item "$master->gridPropagate?(boolean)?"
296If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR
297then propagation is enabled for \fI$master\fR, which must be a window
298name (see \*(L"\s-1GEOMETRY\s0 \s-1PROPAGATION\s0\*(R" below).
299If \fIboolean\fR has a false boolean value then propagation is
300disabled for \fI$master\fR.
301In either of these cases an empty string is returned.
302If \fIboolean\fR is omitted then the method returns \fB0\fR or
303\&\fB1\fR to indicate whether propagation is currently enabled
304for \fI$master\fR.
305Propagation is enabled by default.
306.IP "\fI$master\fR\->\fBgridRowconfigure\fR(\fIindex\fR?, \fI\-option\fR=>\fIvalue, ...\fR?)" 4
307.IX Item "$master->gridRowconfigure(index?, -option=>value, ...?)"
308Query or set the row properties of the \fIindex\fR row of the
309geometry master, \fI$master\fR.
310The valid options are \fB\-minsize\fR, \fB\-weight\fR and \fB\-pad\fR.
311If one or more options are provided, then \fIindex\fR may be given as
312a list of row indeces to which the configuration options will operate on.
313The \fB\-minsize\fR option sets the minimum size, in screen units,
314that will be permitted for this row.
315The \fB\-weight\fR option (an integer value)
316sets the relative weight for apportioning
317any extra spaces among
318rows.
319A weight of zero (0) indicates the row will not deviate from its requested
320size. A row whose weight is two will grow at twice the rate as a row
321of weight one when extra space is allocated to the layout.
322The \fB\-pad\fR option specifies the number of screen units that will be
323added to the largest window contained completely in that row when the
324grid geometry manager requests a size from the containing window.
325If only an option is specified, with no value,
326the current value of that option is returned.
327If only the master window and index is specified, all the current settings
328are returned in an list of \*(L"option\-value\*(R" pairs.
329.IP "\fI$slave\fR\->\fBgridRemove\fR?(\fI$slave, ...\fR)?" 4
330.IX Item "$slave->gridRemove?($slave, ...)?"
331Removes each of the \fI$slave\fRs from grid for its
332master and unmaps their windows.
333The slaves will no longer be managed by the grid geometry manager.
334However, the configuration options for that window are remembered,
335so that if the
336slave is managed once more by the grid geometry manager, the previous
337values are retained.
338.IP "\fI$master\fR\->\fBgridSize\fR" 4
339.IX Item "$master->gridSize"
340Returns the size of the grid (in columns then rows) for \fI$master\fR.
341The size is determined either by the \fI$slave\fR occupying the largest
342row or column, or the largest column or row with a \fB\-minsize\fR,
343\&\fB\-weight\fR, or \fB\-pad\fR that is non\-zero.
344.IP "\fI$master\fR\->\fBgridSlaves\fR?(\fI\-option\fR=>\fIvalue\fR)?" 4
345.IX Item "$master->gridSlaves?(-option=>value)?"
346If no options are supplied, a list of all of the slaves in \fI$master\fR
347are returned, most recently manages first.
348\&\fI\-option\fR can be either \fB\-row\fR or \fB\-column\fR which
349causes only the slaves in the row (or column) specified by \fIvalue\fR
350to be returned.
351.SH "RELATIVE PLACEMENT"
352.IX Header "RELATIVE PLACEMENT"
353The \fBgrid\fR method contains a limited set of capabilities that
354permit layouts to be created without specifying the row and column
355information for each slave. This permits slaves to be rearranged,
356added, or removed without the need to explicitly specify row and
357column information.
358When no column or row information is specified for a \fI$slave\fR,
359default values are chosen for
360\&\fB\-column\fR, \fB\-row\fR, \fB\-columnspan\fR and \fB\-rowspan\fR
361at the time the \fI$slave\fR is managed. The values are chosen
362based upon the current layout of the grid, the position of the \fI$slave\fR
363relative to other \fI$slave\fRs in the same grid method, and the presence
364of the characters \fB\-\fR, \fB^\fR, and \fB^\fR in \fBgrid\fR
365method where \fI$slave\fR names are normally expected.
366.IP "\fB\-\fR" 4
367.IX Item "-"
368This increases the columnspan of the \fI$slave\fR to the left. Several
369\&\fB\-\fR's in a row will successively increase the columnspan. A \fB\-\fR
370may not follow a \fB^\fR or a \fBx\fR.
371.IP "\fBx\fR" 4
372.IX Item "x"
373This leaves an empty column between the \fI$slave\fR on the left and
374the \fI$slave\fR on the right.
375.IP "\fB^\fR" 4
376.IX Item "^"
377This extends the \fB\-rowspan\fR of the \fI$slave\fR above the \fB^\fR's
378in the grid. The number of \fB^\fR's in a row must match the number of
379columns spanned by the \fI$slave\fR above it.
380.SH "THE GRID ALGORITHM"
381.IX Header "THE GRID ALGORITHM"
382The grid geometry manager lays out its slaves in three steps.
383In the first step, the minimum size needed to fit all of the slaves
384is computed, then (if propagation is turned on), a request is made
385of the master window to become that size.
386In the second step, the requested size is compared against the actual size
387of the master. If the sizes are different, then space is added to or taken
388away from the layout as needed.
389For the final step, each slave is positioned in its row(s) and column(s)
390based on the setting of its \fIsticky\fR flag.
391.PP
392To compute the minimum size of a layout, the grid geometry manager
393first looks at all slaves whose columnspan and rowspan values are one,
394and computes the nominal size of each row or column to be either the
395\&\fIminsize\fR for that row or column, or the sum of the \fIpad\fRding
396plus the size of the largest slave, whichever is greater. Then the
397slaves whose rowspans or columnspans are greater than one are
398examined. If a group of rows or columns need to be increased in size
399in order to accommodate these slaves, then extra space is added to each
400row or column in the group according to its \fIweight\fR. For each
401group whose weights are all zero, the additional space is apportioned
402equally.
403.PP
404For masters whose size is larger than the requested layout, the additional
405space is apportioned according to the row and column weights. If all of
406the weights are zero, the layout is centered within its master.
407For masters whose size is smaller than the requested layout, space is taken
408away from columns and rows according to their weights. However, once a
409column or row shrinks to its minsize, its weight is taken to be zero.
410If more space needs to be removed from a layout than would be permitted, as
411when all the rows or columns are at there minimum sizes, the layout is
412clipped on the bottom and right.
413.SH "GEOMETRY PROPAGATION"
414.IX Header "GEOMETRY PROPAGATION"
415The grid geometry manager normally computes how large a master must be to
416just exactly meet the needs of its slaves, and it sets the
417requested width and height of the master to these dimensions.
418This causes geometry information to propagate up through a
419window hierarchy to a top-level window so that the entire
420sub-tree sizes itself to fit the needs of the leaf windows.
421However, the \fBgridPropagate\fR method may be used to
422turn off propagation for one or more masters.
423If propagation is disabled then grid will not set
424the requested width and height of the master window.
425This may be useful if, for example, you wish for a master
426window to have a fixed size that you specify.
427.SH "RESTRICTIONS ON MASTER WINDOWS"
428.IX Header "RESTRICTIONS ON MASTER WINDOWS"
429The master for each slave must either be the slave's parent
430(the default) or a descendant of the slave's parent.
431This restriction is necessary to guarantee that the
432slave can be placed over any part of its master that is
433visible without danger of the slave being clipped by its parent.
434In addition, all slaves in one call to \fBgrid\fR must have the same master.
435.SH "STACKING ORDER"
436.IX Header "STACKING ORDER"
437If the master for a slave is not its parent then you must make sure
438that the slave is higher in the stacking order than the master.
439Otherwise the master will obscure the slave and it will appear as
440if the slave hasn't been managed correctly.
441The easiest way to make sure the slave is higher than the master is
442to create the master window first: the most recently created window
443will be highest in the stacking order.
444.SH "CREDITS"
445.IX Header "CREDITS"
446The \fBgrid\fR method is based on ideas taken from the \fIGridBag\fR
447geometry manager written by Doug. Stein, and the \fBblt_table\fR geometry
448manager, written by George Howlett.
449.SH "SEE ALSO"
450.IX Header "SEE ALSO"
451Tk::form
452Tk::pack
453Tk::place
454.SH "KEYWORDS"
455.IX Header "KEYWORDS"
456geometry manager, location, grid, cell, propagation, size, pack,
457master, slave