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