Commit | Line | Data |
---|---|---|
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" | |
134 | Tk::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" | |
142 | The \fBgrid\fR method is used to communicate with the grid | |
143 | geometry manager that arranges widgets in rows and columns inside | |
144 | of another window, called the geometry master (or master window). | |
145 | The \fBgrid\fR method can have any of several forms, depending | |
146 | on the \fIoption\fR argument: | |
147 | .IP "\fI$slave\fR\->\fBgrid\fR(?\fI$slave, ...\fR??, \fIoptions\fR?)" 4 | |
148 | .IX Item "$slave->grid(?$slave, ...??, options?)" | |
149 | The arguments consist of the optional references to more slave windows | |
150 | followed by pairs of arguments that specify how to manage the slaves. | |
151 | The characters \fB\-\fR, \fBx\fR and \fB^\fR, | |
152 | can be specified instead of a window reference to alter the default | |
153 | location of a \fI$slave\fR, as described in \*(L"\s-1RELATIVE\s0 \s-1PLACEMENT\s0\*(R", below. | |
154 | .Sp | |
155 | If any of the slaves are already managed by the geometry manager | |
156 | then any unspecified options for them retain their previous values rather | |
157 | than receiving default values. | |
158 | .Sp | |
159 | The following options are supported: | |
160 | .RS 4 | |
161 | .IP "\fB\-column\fR => \fIn\fR" 8 | |
162 | .IX Item "-column => n" | |
163 | Insert the \fI$slave\fR so that it occupies the \fIn\fRth column in the grid. | |
164 | Column 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 | |
166 | call 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 | |
168 | is incremented by one. Thus the \fBx\fR represents a blank column | |
169 | for this row in the grid. | |
170 | .IP "\fB\-columnspan\fR => \fIn\fR" 8 | |
171 | .IX Item "-columnspan => n" | |
172 | Insert the slave so that it occupies \fIn\fR columns in the grid. | |
173 | The 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 | |
175 | following \fB\-\fR. | |
176 | .IP "\fB\-in\fR => \fI$other\fR" 8 | |
177 | .IX Item "-in => $other" | |
178 | Insert the slave(s) in the master | |
179 | window given by \fI$other\fR. The default is the first slave's | |
180 | parent window. | |
181 | .IP "\fB\-ipadx\fR => \fIamount\fR" 8 | |
182 | .IX Item "-ipadx => amount" | |
183 | The \fIamount\fR specifies how much horizontal internal padding to | |
184 | leave on each side of the slave(s). This is space is added | |
185 | inside the slave(s) border. | |
186 | The \fIamount\fR must be a valid screen distance, such as \fB2\fR or \fB'.5c'\fR. | |
187 | It defaults to 0. | |
188 | .IP "\fB\-ipady\fR => \fIamount\fR" 8 | |
189 | .IX Item "-ipady => amount" | |
190 | The \fIamount\fR specifies how much vertical internal padding to | |
191 | leave on on the top and bottom of the slave(s). | |
192 | This space is added inside the slave(s) border. | |
193 | The \fIamount\fR defaults to 0. | |
194 | .IP "\fB\-padx\fR => \fIamount\fR" 8 | |
195 | .IX Item "-padx => amount" | |
196 | The \fIamount\fR specifies how much horizontal external padding to | |
197 | leave on each side of the slave(s), in screen units. | |
198 | The \fIamount\fR defaults to 0. | |
199 | This space is added outside the slave(s) border. | |
200 | .IP "\fB\-pady\fR => \fIamount\fR" 8 | |
201 | .IX Item "-pady => amount" | |
202 | The \fIamount\fR specifies how much vertical external padding to | |
203 | leave on the top and bottom of the slave(s), in screen units. | |
204 | The \fIamount\fR defaults to 0. | |
205 | This space is added outside the slave(s) border. | |
206 | .IP "\fB\-row\fR => \fIn\fR" 8 | |
207 | .IX Item "-row => n" | |
208 | Insert the slave so that it occupies the \fIn\fRth row in the grid. | |
209 | Row numbers start with 0. If this option is not supplied, then the | |
210 | slave is arranged on the same row as the previous slave specified on this | |
211 | call 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" | |
214 | Insert the slave so that it occupies \fIn\fR rows in the grid. | |
215 | The 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 | |
217 | of this \fI$slave\fR, then the \fBrowspan\fR of this \fI$slave\fR is | |
218 | extended by one. | |
219 | .IP "\fB\-sticky\fR => \fIstyle\fR" 8 | |
220 | .IX Item "-sticky => style" | |
221 | If a slave's cell is larger than its requested dimensions, this | |
222 | option 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. | |
225 | The string can optionally contain spaces or | |
226 | commas, but they are ignored. Each letter refers to a side (north, south, | |
227 | east, 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 | |
229 | height (or width) of its cavity. The \fBsticky\fR option subsumes the | |
230 | combination of \fB\-anchor\fR and \fB\-fill\fR that is used by pack. | |
231 | The default is \fB''\fR, which causes the slave to be centered in its cavity, | |
232 | at 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?)" | |
238 | With no arguments, | |
239 | the bounding box (in pixels) of the grid is returned. | |
240 | The return value consists of 4 integers. The first two are the pixel | |
241 | offset from the master window (x then y) of the top-left corner of the | |
242 | grid, and the second two integers are the width and height of the grid, | |
243 | also in pixels. If a single \fIcolumn\fR and \fIrow\fR is specified on | |
244 | the command line, then the bounding box for that cell is returned, where the | |
245 | top left cell is numbered from zero. If both \fIcolumn\fR and \fIrow\fR | |
246 | arguments are specified, then the bounding box spanning the rows and columns | |
247 | indicated 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, ...?)" | |
250 | Query or set the column properties of the \fIindex\fR column of the | |
251 | geometry master, \fI$master\fR. | |
252 | The valid options are \fB\-minsize\fR, \fB\-weight\fR and \fB\-pad\fR. | |
253 | If one or more options are provided, then \fIindex\fR may be given as | |
254 | a list of column indices to which the configuration options will operate on. | |
255 | The \fB\-minsize\fR option sets the minimum size, in screen units, | |
256 | that will be permitted for this column. | |
257 | The \fB\-weight\fR option (an integer value) | |
258 | sets the relative weight for apportioning | |
259 | any extra spaces among | |
260 | columns. | |
261 | A weight of zero (0) indicates the column will not deviate from its requested | |
262 | size. A column whose weight is two will grow at twice the rate as a column | |
263 | of weight one when extra space is allocated to the layout. | |
264 | The \fB\-pad\fR option specifies the number of screen units that will be | |
265 | added to the largest window contained completely in that column when the | |
266 | grid geometry manager requests a size from the containing window. | |
267 | If only an option is specified, with no value, | |
268 | the current value of that option is returned. | |
269 | If only the master window and index is specified, all the current settings | |
270 | are 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?)" | |
273 | The same as \fBgrid\fR method. | |
274 | .IP "\fI$slave\fR\->\fBgridForget\fR?(\fI$slave, ...\fR)?" 4 | |
275 | .IX Item "$slave->gridForget?($slave, ...)?" | |
276 | Removes each of the \fI$slave\fRs from grid for its | |
277 | master and unmaps their windows. | |
278 | The slaves will no longer be managed by the grid geometry manager. | |
279 | The configuration options for that window are forgotten, so that if the | |
280 | slave is managed once more by the grid geometry manager, the initial | |
281 | default settings are used. | |
282 | .IP "\fI$slave\fR\->\fBgridInfo\fR" 4 | |
283 | .IX Item "$slave->gridInfo" | |
284 | Returns a list whose elements are the current configuration state of | |
285 | the slave given by \fI$slave\fR in the same option-value form that | |
286 | might be specified to \fBgridConfigure\fR. | |
287 | The 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)" | |
291 | Given \fIx\fR and \fIy\fR values in screen units relative to the master window, | |
292 | the column and row number at that \fIx\fR and \fIy\fR location is returned. | |
293 | For 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)?" | |
296 | If \fIboolean\fR has a true boolean value such as \fB1\fR or \fBon\fR | |
297 | then propagation is enabled for \fI$master\fR, which must be a window | |
298 | name (see \*(L"\s-1GEOMETRY\s0 \s-1PROPAGATION\s0\*(R" below). | |
299 | If \fIboolean\fR has a false boolean value then propagation is | |
300 | disabled for \fI$master\fR. | |
301 | In either of these cases an empty string is returned. | |
302 | If \fIboolean\fR is omitted then the method returns \fB0\fR or | |
303 | \&\fB1\fR to indicate whether propagation is currently enabled | |
304 | for \fI$master\fR. | |
305 | Propagation 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, ...?)" | |
308 | Query or set the row properties of the \fIindex\fR row of the | |
309 | geometry master, \fI$master\fR. | |
310 | The valid options are \fB\-minsize\fR, \fB\-weight\fR and \fB\-pad\fR. | |
311 | If one or more options are provided, then \fIindex\fR may be given as | |
312 | a list of row indeces to which the configuration options will operate on. | |
313 | The \fB\-minsize\fR option sets the minimum size, in screen units, | |
314 | that will be permitted for this row. | |
315 | The \fB\-weight\fR option (an integer value) | |
316 | sets the relative weight for apportioning | |
317 | any extra spaces among | |
318 | rows. | |
319 | A weight of zero (0) indicates the row will not deviate from its requested | |
320 | size. A row whose weight is two will grow at twice the rate as a row | |
321 | of weight one when extra space is allocated to the layout. | |
322 | The \fB\-pad\fR option specifies the number of screen units that will be | |
323 | added to the largest window contained completely in that row when the | |
324 | grid geometry manager requests a size from the containing window. | |
325 | If only an option is specified, with no value, | |
326 | the current value of that option is returned. | |
327 | If only the master window and index is specified, all the current settings | |
328 | are 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, ...)?" | |
331 | Removes each of the \fI$slave\fRs from grid for its | |
332 | master and unmaps their windows. | |
333 | The slaves will no longer be managed by the grid geometry manager. | |
334 | However, the configuration options for that window are remembered, | |
335 | so that if the | |
336 | slave is managed once more by the grid geometry manager, the previous | |
337 | values are retained. | |
338 | .IP "\fI$master\fR\->\fBgridSize\fR" 4 | |
339 | .IX Item "$master->gridSize" | |
340 | Returns the size of the grid (in columns then rows) for \fI$master\fR. | |
341 | The size is determined either by the \fI$slave\fR occupying the largest | |
342 | row 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)?" | |
346 | If no options are supplied, a list of all of the slaves in \fI$master\fR | |
347 | are returned, most recently manages first. | |
348 | \&\fI\-option\fR can be either \fB\-row\fR or \fB\-column\fR which | |
349 | causes only the slaves in the row (or column) specified by \fIvalue\fR | |
350 | to be returned. | |
351 | .SH "RELATIVE PLACEMENT" | |
352 | .IX Header "RELATIVE PLACEMENT" | |
353 | The \fBgrid\fR method contains a limited set of capabilities that | |
354 | permit layouts to be created without specifying the row and column | |
355 | information for each slave. This permits slaves to be rearranged, | |
356 | added, or removed without the need to explicitly specify row and | |
357 | column information. | |
358 | When no column or row information is specified for a \fI$slave\fR, | |
359 | default values are chosen for | |
360 | \&\fB\-column\fR, \fB\-row\fR, \fB\-columnspan\fR and \fB\-rowspan\fR | |
361 | at the time the \fI$slave\fR is managed. The values are chosen | |
362 | based upon the current layout of the grid, the position of the \fI$slave\fR | |
363 | relative to other \fI$slave\fRs in the same grid method, and the presence | |
364 | of the characters \fB\-\fR, \fB^\fR, and \fB^\fR in \fBgrid\fR | |
365 | method where \fI$slave\fR names are normally expected. | |
366 | .IP "\fB\-\fR" 4 | |
367 | .IX Item "-" | |
368 | This 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 | |
370 | may not follow a \fB^\fR or a \fBx\fR. | |
371 | .IP "\fBx\fR" 4 | |
372 | .IX Item "x" | |
373 | This leaves an empty column between the \fI$slave\fR on the left and | |
374 | the \fI$slave\fR on the right. | |
375 | .IP "\fB^\fR" 4 | |
376 | .IX Item "^" | |
377 | This extends the \fB\-rowspan\fR of the \fI$slave\fR above the \fB^\fR's | |
378 | in the grid. The number of \fB^\fR's in a row must match the number of | |
379 | columns spanned by the \fI$slave\fR above it. | |
380 | .SH "THE GRID ALGORITHM" | |
381 | .IX Header "THE GRID ALGORITHM" | |
382 | The grid geometry manager lays out its slaves in three steps. | |
383 | In the first step, the minimum size needed to fit all of the slaves | |
384 | is computed, then (if propagation is turned on), a request is made | |
385 | of the master window to become that size. | |
386 | In the second step, the requested size is compared against the actual size | |
387 | of the master. If the sizes are different, then space is added to or taken | |
388 | away from the layout as needed. | |
389 | For the final step, each slave is positioned in its row(s) and column(s) | |
390 | based on the setting of its \fIsticky\fR flag. | |
391 | .PP | |
392 | To compute the minimum size of a layout, the grid geometry manager | |
393 | first looks at all slaves whose columnspan and rowspan values are one, | |
394 | and 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 | |
396 | plus the size of the largest slave, whichever is greater. Then the | |
397 | slaves whose rowspans or columnspans are greater than one are | |
398 | examined. If a group of rows or columns need to be increased in size | |
399 | in order to accommodate these slaves, then extra space is added to each | |
400 | row or column in the group according to its \fIweight\fR. For each | |
401 | group whose weights are all zero, the additional space is apportioned | |
402 | equally. | |
403 | .PP | |
404 | For masters whose size is larger than the requested layout, the additional | |
405 | space is apportioned according to the row and column weights. If all of | |
406 | the weights are zero, the layout is centered within its master. | |
407 | For masters whose size is smaller than the requested layout, space is taken | |
408 | away from columns and rows according to their weights. However, once a | |
409 | column or row shrinks to its minsize, its weight is taken to be zero. | |
410 | If more space needs to be removed from a layout than would be permitted, as | |
411 | when all the rows or columns are at there minimum sizes, the layout is | |
412 | clipped on the bottom and right. | |
413 | .SH "GEOMETRY PROPAGATION" | |
414 | .IX Header "GEOMETRY PROPAGATION" | |
415 | The grid geometry manager normally computes how large a master must be to | |
416 | just exactly meet the needs of its slaves, and it sets the | |
417 | requested width and height of the master to these dimensions. | |
418 | This causes geometry information to propagate up through a | |
419 | window hierarchy to a top-level window so that the entire | |
420 | sub-tree sizes itself to fit the needs of the leaf windows. | |
421 | However, the \fBgridPropagate\fR method may be used to | |
422 | turn off propagation for one or more masters. | |
423 | If propagation is disabled then grid will not set | |
424 | the requested width and height of the master window. | |
425 | This may be useful if, for example, you wish for a master | |
426 | window to have a fixed size that you specify. | |
427 | .SH "RESTRICTIONS ON MASTER WINDOWS" | |
428 | .IX Header "RESTRICTIONS ON MASTER WINDOWS" | |
429 | The master for each slave must either be the slave's parent | |
430 | (the default) or a descendant of the slave's parent. | |
431 | This restriction is necessary to guarantee that the | |
432 | slave can be placed over any part of its master that is | |
433 | visible without danger of the slave being clipped by its parent. | |
434 | In addition, all slaves in one call to \fBgrid\fR must have the same master. | |
435 | .SH "STACKING ORDER" | |
436 | .IX Header "STACKING ORDER" | |
437 | If the master for a slave is not its parent then you must make sure | |
438 | that the slave is higher in the stacking order than the master. | |
439 | Otherwise the master will obscure the slave and it will appear as | |
440 | if the slave hasn't been managed correctly. | |
441 | The easiest way to make sure the slave is higher than the master is | |
442 | to create the master window first: the most recently created window | |
443 | will be highest in the stacking order. | |
444 | .SH "CREDITS" | |
445 | .IX Header "CREDITS" | |
446 | The \fBgrid\fR method is based on ideas taken from the \fIGridBag\fR | |
447 | geometry manager written by Doug. Stein, and the \fBblt_table\fR geometry | |
448 | manager, written by George Howlett. | |
449 | .SH "SEE ALSO" | |
450 | .IX Header "SEE ALSO" | |
451 | Tk::form | |
452 | Tk::pack | |
453 | Tk::place | |
454 | .SH "KEYWORDS" | |
455 | .IX Header "KEYWORDS" | |
456 | geometry manager, location, grid, cell, propagation, size, pack, | |
457 | master, slave |