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 "FORM 1" | |
132 | .TH FORM 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation" | |
133 | .SH "NAME" | |
134 | Tk::form \- Geometry manager based on attachment rules | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | \&\ \fI$widget\fR\->\fBform\fR?(\fIargs\fR)? | |
138 | .PP | |
139 | \&\ \fI$widget\fR\->\fBform\fR\fIOption\fR?(\fIargs\fR)? | |
140 | .SH "DESCRIPTION" | |
141 | .IX Header "DESCRIPTION" | |
142 | The \fBform\fR method is used to communicate with the | |
143 | \&\fBform\fR Geometry Manager, a geometry manager that arranges the | |
144 | geometry of the children in a parent window according to attachment | |
145 | rules. The \fBform\fR geometry manager is very flexible and | |
146 | powerful; it can be used to emulate all the existing features of the | |
147 | Tk packer and placer geometry managers (see pack, | |
148 | place). | |
149 | The \fBform\fR method can have any of several forms, | |
150 | depending on \fIOption\fR: | |
151 | .IP "\fI$slave\fR\->\fBform\fR?(\fIoptions\fR)?" 4 | |
152 | .IX Item "$slave->form?(options)?" | |
153 | Sets or adjusts the attachment values of the slave window | |
154 | according to the \fI\-option\fR=>\fIvalue\fR argument pairs. | |
155 | .RS 4 | |
156 | .IP "\fB\-b\fR => \fIattachment\fR" 8 | |
157 | .IX Item "-b => attachment" | |
158 | Abbreviation for the \fB\-bottom\fR option. | |
159 | .IP "\fB\-bottom\fR => \fIattachment\fR" 8 | |
160 | .IX Item "-bottom => attachment" | |
161 | Specifies an attachment for the bottom edge of the slave window. The | |
162 | attachment must specified according to \*(L"\s-1SPECIFYING\s0 \s-1ATTACHMENTS\s0\*(R" below. | |
163 | .IP "\fB\-bottomspring\fR => \fIweight\fR" 8 | |
164 | .IX Item "-bottomspring => weight" | |
165 | Specifies the weight of the spring at the bottom edge of the slave | |
166 | window. See \*(L"\s-1USING\s0 \s-1SPRINGS\s0\*(R" below. | |
167 | .IP "\fB\-bp\fR => \fIvalue\fR" 8 | |
168 | .IX Item "-bp => value" | |
169 | Abbreviation for the \fB\-padbottom\fR option. | |
170 | .IP "\fB\-bs\fR => \fIweight\fR" 8 | |
171 | .IX Item "-bs => weight" | |
172 | Abbreviation for the \fB\-bottomspring\fR option. | |
173 | .IP "\fB\-fill\fR => \fIstyle\fR" 8 | |
174 | .IX Item "-fill => style" | |
175 | Specifies the fillings when springs are used for this widget. The | |
176 | value must be \fBx\fR, \fBy\fR, \fBboth\fR or \fBnone\fR. | |
177 | .IP "\fB\-in\fR => \fI$master\fR" 8 | |
178 | .IX Item "-in => $master" | |
179 | Places the slave window into the specified \fI$master\fR window. If the slave | |
180 | was originally in another master window, all attachment values with | |
181 | respect to the original master window are discarded. Even if the | |
182 | attachment values are the same as in the original master window, they | |
183 | need to be specified again. The \fB\-in\fR flag, when needed, must appear | |
184 | as the first flag of \fIoptions\fR. Otherwise an error is | |
185 | generated. | |
186 | .IP "\fB\-l\fR => \fIattachment\fR" 8 | |
187 | .IX Item "-l => attachment" | |
188 | Abbreviation for the \fB\-left\fR option. | |
189 | .IP "\fB\-left\fR => \fIattachment\fR" 8 | |
190 | .IX Item "-left => attachment" | |
191 | Specifies an attachment for the left edge of the slave window. The | |
192 | attachment must specified according to \*(L"\s-1SPECIFYING\s0 \s-1ATTACHMENTS\s0\*(R" below. | |
193 | .IP "\fB\-leftspring\fR => \fIweight\fR" 8 | |
194 | .IX Item "-leftspring => weight" | |
195 | Specifies the weight of the spring at the left edge of the slave | |
196 | window. See \*(L"\s-1USING\s0 \s-1SPRINGS\s0\*(R" below. | |
197 | .IP "\fB\-lp\fR => \fIvalue\fR" 8 | |
198 | .IX Item "-lp => value" | |
199 | Abbreviation for the \fB\-padleft\fR option. | |
200 | .IP "\fB\-ls\fR => \fIweight\fR" 8 | |
201 | .IX Item "-ls => weight" | |
202 | Abbreviation for the \fB\-leftspring\fR option. | |
203 | .IP "\fB\-padbottom\fR => \fIvalue\fR" 8 | |
204 | .IX Item "-padbottom => value" | |
205 | Specifies the amount of external padding to leave on the bottom side | |
206 | of the slave. The \fIvalue\fR may have any of the forms acceptable to | |
207 | \&\fBTk_GetPixels\fR. | |
208 | .IP "\fB\-padleft\fR => \fIvalue\fR" 8 | |
209 | .IX Item "-padleft => value" | |
210 | Specifies the amount of external padding to leave on the left side of | |
211 | the slave. | |
212 | .IP "\fB\-padright\fR => \fIvalue\fR" 8 | |
213 | .IX Item "-padright => value" | |
214 | Specifies the amount of external padding to leave on the right side of | |
215 | the slave. | |
216 | .IP "\fB\-padtop\fR => \fIvalue\fR" 8 | |
217 | .IX Item "-padtop => value" | |
218 | Specifies the amount of external padding to leave on the top side of | |
219 | the slave. | |
220 | .IP "\fB\-padx\fR => \fIvalue\fR" 8 | |
221 | .IX Item "-padx => value" | |
222 | Specifies the amount of external padding to leave on both the left and | |
223 | the right sides of the slave. | |
224 | .IP "\fB\-pady\fR => \fIvalue\fR" 8 | |
225 | .IX Item "-pady => value" | |
226 | Specifies the amount of external padding to leave on both the top and | |
227 | the bottom sides of the slave. | |
228 | .IP "\fB\-r\fR => \fIattachment\fR" 8 | |
229 | .IX Item "-r => attachment" | |
230 | Abbreviation for the \fB\-right\fR option. | |
231 | .IP "\fB\-right\fR => \fIattachment\fR" 8 | |
232 | .IX Item "-right => attachment" | |
233 | Specifies an attachment for the right edge of the slave window. The | |
234 | attachment must specified according to \*(L"\s-1SPECIFYING\s0 \s-1ATTACHMENTS\s0\*(R" below. | |
235 | .IP "\fB\-rightspring\fR => \fIweight\fR" 8 | |
236 | .IX Item "-rightspring => weight" | |
237 | Specifies the weight of the spring at the right edge of the slave | |
238 | window. See \*(L"\s-1USING\s0 \s-1SPRINGS\s0\*(R" below. | |
239 | .IP "\fB\-rp\fR => \fIvalue\fR" 8 | |
240 | .IX Item "-rp => value" | |
241 | Abbreviation for the \fB\-padright\fR option. | |
242 | .IP "\fB\-rs\fR => \fIweight\fR" 8 | |
243 | .IX Item "-rs => weight" | |
244 | Abbreviation for the \fB\-rightspring\fR option. | |
245 | .IP "\fB\-t\fR => \fIattachment\fR" 8 | |
246 | .IX Item "-t => attachment" | |
247 | Abbreviation for the \fB\-top\fR option. | |
248 | .IP "\fB\-top\fR => \fIattachment\fR" 8 | |
249 | .IX Item "-top => attachment" | |
250 | Specifies an attachment for the top edge of the slave window. The | |
251 | attachment must specified according to \*(L"\s-1SPECIFYING\s0 \s-1ATTACHMENTS\s0\*(R" below. | |
252 | .IP "\fB\-topspring\fR => \fIweight\fR" 8 | |
253 | .IX Item "-topspring => weight" | |
254 | Specifies the weight of the spring at the top edge of the slave | |
255 | window. See \*(L"\s-1USING\s0 \s-1SPRINGS\s0\*(R" below. | |
256 | .IP "\fB\-tp\fR => \fIvalue\fR" 8 | |
257 | .IX Item "-tp => value" | |
258 | Abbreviation for the \fB\-padtop\fR option. | |
259 | .IP "\fB\-ts\fR => \fIweight\fR" 8 | |
260 | .IX Item "-ts => weight" | |
261 | Abbreviation for the \fB\-topspring\fR option. | |
262 | .RE | |
263 | .RS 4 | |
264 | .RE | |
265 | .IP "\fI$master\fR\->\fBformCheck\fR" 4 | |
266 | .IX Item "$master->formCheck" | |
267 | This method checks whether there is circular dependency in the | |
268 | attachments of the master's slaves (see \*(L"\s-1CIRCULAR\s0 \s-1DEPENDENCY\s0\*(R" below). | |
269 | It returns the Boolean value \fB\s-1TRUE\s0\fR if it | |
270 | discover circular dependency and \fB\s-1FALSE\s0\fR otherwise. | |
271 | .IP "\fI$slave\fR\->\fBformForget\fR" 4 | |
272 | .IX Item "$slave->formForget" | |
273 | Removes the slave from its master and unmaps its window. | |
274 | The slave will no longer be managed by form. All attachment values | |
275 | with respect to its master window are discarded. If another slave | |
276 | is attached to this slave, then the attachment of the other slave will | |
277 | be changed to grid attachment based on its geometry. | |
278 | .IP "\fI$master\fR\->\fBformGrid\fR?(\fIx_size, y_size\fR)?" 4 | |
279 | .IX Item "$master->formGrid?(x_size, y_size)?" | |
280 | When \fIx_size\fR and \fIy_size\fR are given, this method returns the | |
281 | number of grids of the \fI$master\fR window in a pair of integers of the form | |
282 | (\fIx_size, y_size\fR). When both \fIx_size\fR and \fIy_size\fR are | |
283 | given, this method changes the number of horizontal and vertical | |
284 | grids on the master window. | |
285 | .IP "\fI$slave\fR\->\fBformInfo\fR?(\fI\-option)\fR?" 4 | |
286 | .IX Item "$slave->formInfo?(-option)?" | |
287 | Queries the attachment options of a slave window. \fI\-option\fR can be | |
288 | any of the options accepted by the \fBform\fR method. If | |
289 | \&\fI\-option\fR is given, only the value of that option is returned. | |
290 | Otherwise, this method returns a list whose elements are the current | |
291 | configuration state of the slave given in the same \fIoption-value\fR form | |
292 | that might be specified to \fBform\fR. The first two | |
293 | elements in this list list are "\fB\-in\fR=>\fI$master\fR" where | |
294 | \&\fI$master\fR is the slave's master window. | |
295 | .IP "\fI$master\fR\->\fBformSlaves\fR" 4 | |
296 | .IX Item "$master->formSlaves" | |
297 | Returns a list of all of the slaves for the master window. The order | |
298 | of the slaves in the list is the same as their order in the packing | |
299 | order. If master has no slaves then an empty string is returned. | |
300 | .SH "SPECIFYING ATTACHMENTS" | |
301 | .IX Header "SPECIFYING ATTACHMENTS" | |
302 | One can specify an attachment for each side of a slave window managed | |
303 | by form. An attachment is specified in the the form "\-\fIside\fR => | |
304 | [\fIanchor_point\fR, \fIoffset\fR]". \-\fIside\fR can be one of | |
305 | \&\fB\-top\fR, \fB\-bottom\fR, \fB\-left\fR or \fB\-right\fR. | |
306 | .PP | |
307 | \&\fIOffset\fR is given in screen units (i.e. any of the forms | |
308 | acceptable to \fBTk_GetPixels\fR). A positive offset indicates | |
309 | shifting to a position to the right or bottom of an anchor point. A | |
310 | negative offset indicates shifting to a position to the left or top of | |
311 | an anchor point. | |
312 | .PP | |
313 | \&\fIAnchor_point\fR can be given in one of the | |
314 | following forms: | |
315 | .IP "\fBGrid Attachment\fR" 4 | |
316 | .IX Item "Grid Attachment" | |
317 | The master window is divided into a number of horizontal and vertical | |
318 | grids. By default the master window is divided into 100x100 grids; the | |
319 | number of grids can be adjusted by the \fBformGrid\fR method. A | |
320 | grid attachment anchor point is given by a \fB%\fR sign followed by an | |
321 | integer value. For example, \fB'%0'\fR specifies the first grid | |
322 | line (the top or left edge of the master window). \fB'%100'\fR specifies | |
323 | the last grid line (the bottom or right edge of the master window). | |
324 | .IP "\fBOpposite Side Attachment\fR" 4 | |
325 | .IX Item "Opposite Side Attachment" | |
326 | Opposite attachment specifies an anchor point located on the | |
327 | \&\fBopposite\fR side of another slave widget, which must be managed by | |
328 | form in the same master window. An opposite attachment anchor point | |
329 | is given by the name of another widget. For example, | |
330 | "\fI$b\fR\->\fBform\fR(\fB\-top\fR=>[\fI$a\fR,0])" attaches the top side of the widget \fI$b\fR to the | |
331 | bottom of the widget \fI$a\fR. | |
332 | .IP "\fBParallel Side Attachment\fR" 4 | |
333 | .IX Item "Parallel Side Attachment" | |
334 | Opposite attachment specifies an anchor point located on the | |
335 | \&\fBsame\fR side of another slave widget, which must be managed by | |
336 | form in the same master window. An parallel attachment anchor point | |
337 | is given by the sign \fB&\fR follwed by the name of another widget. | |
338 | For example, "\fI$b\fR\->\fBform\fR(\fB\-top\fR=>['&',\fI$a\fR,0])" attaches the top side of | |
339 | the widget \fI$b\fR to the top of the widget \fI$a\fR, making | |
340 | the top sides of these two widgets at the same vertical position | |
341 | in their parent window. | |
342 | .IP "\fBNo Attachment\fR" 4 | |
343 | .IX Item "No Attachment" | |
344 | Specifies a side of the slave to be attached to nothing, indicated by | |
345 | the keyword \fBnone\fR. When the \fBnone\fR anchor point is given, the | |
346 | offset must be zero (or not present). | |
347 | When a side of a slave is attached to \fB['none', 0]\fR, the position | |
348 | of this side is calculated by the position of the other side and the | |
349 | natural size of the slave. For example, if a the left side of a | |
350 | widget is attached to \fB['%0', 100]\fR, its right side attached to | |
351 | \&\fB['none', 0]\fR, and the natural size of the widget is \fB50\fR pixels, | |
352 | the right side of the widget will be positioned at pixel | |
353 | \&\fB['%0', 149]\fR. | |
354 | When both \fB\-top\fR and \fB\-bottom\fR are attached to \fBnone\fR, | |
355 | then by default \fB\-top\fR will be attached to \fB['%0', 0]\fR. When both | |
356 | \&\fB\-left\fR and \fB\-right\fR are attached to none, then by default | |
357 | \&\fB\-left\fR will be attached to \fB['%0', 0]\fR. | |
358 | .PP | |
359 | Shifting effects can be achieved by specifying a non-zero offset with | |
360 | an anchor point. In the following example, the top side of | |
361 | widget \fI\e$b\fR is attached to the bottom of | |
362 | \&\fI\e$a\fR; hence \fI\e$b\fR | |
363 | always appears below \fI\e$a\fR. Also, the left edge of \fI\e$b\fR | |
364 | is attached to the left side of \fI\e$a\fR with a 10 | |
365 | pixel offest. Therefore, the left edge of \fI\e$b\fR is always | |
366 | shifted 10 pixels to the right of \fI\e$a\fR's left edge: | |
367 | .PP | |
368 | \&\ \fI$b\fR\->\fBform\fR(\fB\-left\fR=>[\fI$a\fR,10], \fB\-top\fR=>[\fI$a\fR,0]); | |
369 | .Sh "\s-1ABBREVIATIONS:\s0" | |
370 | .IX Subsection "ABBREVIATIONS:" | |
371 | Certain abbreviations can be made on the | |
372 | attachment specifications: First an offset of zero can be omitted. | |
373 | Thus, the following two lines are equivalent: | |
374 | .PP | |
375 | \&\ \fI$b\fR\->\fBform\fR(\fB\-top\fR=>[\fI$a\fR,0], \fB\-right\fR=>['%100',0]); | |
376 | .PP | |
377 | \&\ \fI$b\fR\->\fBform\fR(\fB\-top\fR=>[\fI$a\fR], \fB\-right\fR=>'%100'); | |
378 | .PP | |
379 | In the second case, when the anchor point is omitted, the offset must | |
380 | be given. A default anchor point is chosen according to the value of | |
381 | the offset. If the anchor point is \fB0\fR or positive, the default | |
382 | anchor point \f(CW%0\fR is used; thus, "\fI$b\fR\->\fBform\fR(\fB\-top\fR=>15)" attaches the top | |
383 | edge of \fI$b\fR to a position 15 pixels below the top edge of the | |
384 | master window. If the anchor point is "\fB\-0\fR" or negative, the | |
385 | default anchor point \fB%100\fR is used; thus, "\fI$a\fR\->\fBform\fR(\fB\-right\fR=>\-2)" | |
386 | attaches the right edge of \fI\e$a\fR to a position 2 pixels to | |
387 | the left of the master window's right edge. An further example | |
388 | below shows a method with its equivalent abbreviation. | |
389 | .PP | |
390 | \&\ \fI$b\fR\->\fBform\fR(\fB\-top\fR=>['%0',10], \fB\-bottom\fR=>['%100',0]); | |
391 | .PP | |
392 | \&\ \fI$b\fR\->\fBform\fR(\fB\-top\fR=>10, \fB\-bottom\fR=>\-0); | |
393 | .SH "USING SPRINGS" | |
394 | .IX Header "USING SPRINGS" | |
395 | To be written. | |
396 | .SH "ALGORITHM OF FORM" | |
397 | .IX Header "ALGORITHM OF FORM" | |
398 | \&\fBform\fR starts with any slave in the list of slaves of the master | |
399 | window. Then it tries to determine the position of each side of the | |
400 | slave. | |
401 | .PP | |
402 | If the attachment of a side of the slave is grid attachment, the | |
403 | position of the side is readily determined. | |
404 | .PP | |
405 | If the attachment of this side is \fBnone\fR, then form tries to | |
406 | determine the position of the opposite side first, and then use the | |
407 | position of the opposite side and the natural size of the slave to | |
408 | determine the position of this side. | |
409 | .PP | |
410 | If the attachment is opposite or parallel widget attachments, then | |
411 | form tries to determine the positions of the other widget first, | |
412 | and then use the positions of the other widget and the natural size of | |
413 | the slave determine the position of this side. This recursive | |
414 | algorithmis carried on until the positions of all slaves are | |
415 | determined. | |
416 | .SH "CIRCULAR DEPENDENCY" | |
417 | .IX Header "CIRCULAR DEPENDENCY" | |
418 | The algorithm of form will fail if a circular dependency exists in | |
419 | the attachments of the slaves. For example: | |
420 | .PP | |
421 | \&\ \fI$c\fR\->\fBform\fR(\fB\-left\fR=>\fI$b\fR); | |
422 | .PP | |
423 | \&\ \fI$b\fR\->\fBform\fR(\fB\-right\fR=>\fI$c\fR); | |
424 | .PP | |
425 | In this example, the position of the left side of \fI$b\fR depends on | |
426 | the right side of \fI$c\fR, which in turn depends on the left side of \fI$b\fR. | |
427 | .PP | |
428 | When a circular dependency is discovered during the execution of the | |
429 | form algorithm, form will generate a background error and the | |
430 | geometry of the slaves are undefined (and will be arbitrary). Notice | |
431 | that form only executes the algorithm when the specification of the | |
432 | slaves' attachments is complete. Therefore, it allows intermediate | |
433 | states of circular dependency during the specification of the slaves' | |
434 | attachments. Also, unlike the Motif Form manager widget, form | |
435 | defines circular dependency as | |
436 | ``\fIdependency in the same dimension\fR''. | |
437 | Therefore, the following code fragment will does not | |
438 | have circular dependency because the two widgets do not depend on each | |
439 | other in the same dimension (\fI$b\fR depends \fI$c\fR in the | |
440 | horizontal dimension and \fI$c\fR depends on \fI$b\fR in the vertical | |
441 | dimension): | |
442 | .PP | |
443 | \&\ \fI$b\fR\->\fBform\fR(\fB\-left\fR=>\fI$c\fR); | |
444 | .PP | |
445 | \&\ \fI$c\fR\->\fBform\fR(\fB\-top\fR=>\fI$b\fR); | |
446 | .SH "BUGS" | |
447 | .IX Header "BUGS" | |
448 | Springs have not been fully implemented yet. | |
449 | .SH "SEE ALSO" | |
450 | .IX Header "SEE ALSO" | |
451 | Tk::grid | |
452 | Tk::pack | |
453 | Tk::place | |
454 | .SH "KEYWORDS" | |
455 | .IX Header "KEYWORDS" | |
456 | geometry manager, form, attachment, spring, propagation, size, pack, | |
457 | tix, master, slave |