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 "TREE 1" | |
132 | .TH TREE 1 "2000-12-30" "perl v5.8.0" "User Contributed Perl Documentation" | |
133 | .SH "NAME" | |
134 | Tk::Tree \- Create and manipulate Tree widgets | |
135 | .SH "SYNOPSIS" | |
136 | .IX Header "SYNOPSIS" | |
137 | \&\ \fBuse Tk::Tree;\fR | |
138 | .PP | |
139 | \&\ \fI$tree\fR = \fI$parent\fR\->\fBTree\fR(?\fIoptions\fR?); | |
140 | .SH "SUPER-CLASS" | |
141 | .IX Header "SUPER-CLASS" | |
142 | The \fBTree\fR class is derived from the HList class and inherits all | |
143 | the methods, options and subwidgets of its super\-class. A \fBTree\fR widget is | |
144 | not scrolled by default. | |
145 | .SH "STANDARD OPTIONS" | |
146 | .IX Header "STANDARD OPTIONS" | |
147 | \&\fBTree\fR supports all the standard options of an HList widget. | |
148 | See Tk::options for details on the standard options. | |
149 | .SH "WIDGET-SPECIFIC OPTIONS" | |
150 | .IX Header "WIDGET-SPECIFIC OPTIONS" | |
151 | .IP "Name: \fBbrowseCmd\fR" 4 | |
152 | .IX Item "Name: browseCmd" | |
153 | .PD 0 | |
154 | .IP "Class: \fBBrowseCmd\fR" 4 | |
155 | .IX Item "Class: BrowseCmd" | |
156 | .IP "Switch: \fB\-browsecmd\fR" 4 | |
157 | .IX Item "Switch: -browsecmd" | |
158 | .PD | |
159 | Specifies a callback to call whenever the user browses on an entry | |
160 | (usually by single-clicking on the entry). The callback is called with | |
161 | one argument, the pathname of the entry. | |
162 | .IP "Name: \fBcloseCmd\fR" 4 | |
163 | .IX Item "Name: closeCmd" | |
164 | .PD 0 | |
165 | .IP "Class: \fBCloseCmd\fR" 4 | |
166 | .IX Item "Class: CloseCmd" | |
167 | .IP "Switch: \fB\-closecmd\fR" 4 | |
168 | .IX Item "Switch: -closecmd" | |
169 | .PD | |
170 | Specifies a callback to call whenever an entry needs to be closed (See | |
171 | \&\*(L"\s-1BINDINGS\s0\*(R" below). This method is called with one argument, | |
172 | the pathname of the entry. This method should perform appropriate | |
173 | actions to close the specified entry. If the \fB\-closecmd\fR option | |
174 | is not specified, the default closing action is to hide all child | |
175 | entries of the specified entry. | |
176 | .IP "Name: \fBcommand\fR" 4 | |
177 | .IX Item "Name: command" | |
178 | .PD 0 | |
179 | .IP "Class: \fBCommand\fR" 4 | |
180 | .IX Item "Class: Command" | |
181 | .IP "Switch: \fB\-command\fR" 4 | |
182 | .IX Item "Switch: -command" | |
183 | .PD | |
184 | Specifies a callback to call whenever the user activates an entry | |
185 | (usually by double-clicking on the entry). The callback | |
186 | is called with one argument, the pathname of the entry. | |
187 | .IP "Name: \fBignoreInvoke\fR" 4 | |
188 | .IX Item "Name: ignoreInvoke" | |
189 | .PD 0 | |
190 | .IP "Class: \fBIgnoreInvoke\fR" 4 | |
191 | .IX Item "Class: IgnoreInvoke" | |
192 | .IP "Switch: \fB\-ignoreinvoke\fR" 4 | |
193 | .IX Item "Switch: -ignoreinvoke" | |
194 | .PD | |
195 | A Boolean value that specifies when a branch should be opened or | |
196 | closed. A branch will always be opened or closed when the user presses | |
197 | the (+) and (\-) indicators. However, when the user invokes a branch | |
198 | (by doublc-clicking or pressing <Return>), the branch will be opened | |
199 | or closed only if \fB\-ignoreinvoke\fR is set to false (the default | |
200 | setting). | |
201 | .IP "Name: \fBopenCmd\fR" 4 | |
202 | .IX Item "Name: openCmd" | |
203 | .PD 0 | |
204 | .IP "Class: \fBOpenCmd\fR" 4 | |
205 | .IX Item "Class: OpenCmd" | |
206 | .IP "Switch: \fB\-opencmd\fR" 4 | |
207 | .IX Item "Switch: -opencmd" | |
208 | .PD | |
209 | Specifies a callback to call whenever an entry needs to be opened (See | |
210 | \&\*(L"\s-1BINDINGS\s0\*(R" below). This method is called with one argument, | |
211 | the pathname of the entry. This method should perform appropriate | |
212 | actions to open the specified entry. If the \fB\-opencmd\fR option | |
213 | is not specified, the default opening action is to show all the child | |
214 | entries of the specified entry. | |
215 | .SH "DESCRIPTION" | |
216 | .IX Header "DESCRIPTION" | |
217 | The \fBTree\fR method creates a new window and makes it into a Tree widget | |
218 | and return a reference to it. Additional options, described above, may | |
219 | be specified on the command line or in the option database to configure | |
220 | aspects of the Tree widget such as its cursor and relief. | |
221 | .PP | |
222 | The Tree widget can be used to display hierarchical data in a tree | |
223 | form. The user can adjust the view of the tree by opening or closing | |
224 | parts of the tree. | |
225 | .PP | |
226 | To display a static tree structure, you can add the entries into the | |
227 | Tree widget and hide any entries as desired. Then you can call | |
228 | the \fBautosetmode\fR method. This will set up the Tree widget so that it | |
229 | handles all the \fIopen\fR and \fIclose\fR events automatically. | |
230 | the demonstration program \fITixish/examples/perl\-tix\-tree\fR). | |
231 | .PP | |
232 | The above method is not applicable if you want to maintain a dynamic tree | |
233 | structure, i.e, you do not know all the entries in the tree and you need | |
234 | to add or delete entries subsequently. To do this, you should first create | |
235 | the entries in the Tree widget. Then, use the \fBsetmode\fR method to | |
236 | indicate the entries that can be opened or closed, and use the \fB\-opencmd\fR | |
237 | and \fB\-closecmd\fR options to handle the opening and closing events. (Please | |
238 | see the demonstration program \fITixish/examples/perl\-tix\-dyntree\fR). | |
239 | .PP | |
240 | Use either | |
241 | .PP | |
242 | \&\ \fI$parent\fR\->\fBScrolled\fR(\fB'Tree'\fR, ... ); | |
243 | .PP | |
244 | or | |
245 | .PP | |
246 | \&\ \fI$parent\fR\->\fBScrlTree\fR( ... ); | |
247 | .PP | |
248 | to create a scrolled \fBTree\fR. See Tk::Scrolled for details. | |
249 | .SH "WIDGET METHODS" | |
250 | .IX Header "WIDGET METHODS" | |
251 | The \fBTree\fR method creates a widget object. | |
252 | This object supports the \fBconfigure\fR and \fBcget\fR methods | |
253 | described in Tk::options which can be used to enquire and | |
254 | modify the options described above. | |
255 | The widget also inherits all the methods provided by the generic | |
256 | Tk::Widget class. | |
257 | .PP | |
258 | The following additional methods are available for Tree widgets: | |
259 | .IP "\fI$tree\fR\->\fBautosetmode\fR" 4 | |
260 | .IX Item "$tree->autosetmode" | |
261 | This method calls the \fBsetmode\fR method for all the entries in | |
262 | this Tree widget: if an entry has no child entries, its mode is set to | |
263 | \&\fBnone\fR. Otherwise, if the entry has any hidden child entries, its | |
264 | mode is set to \fBopen\fR; otherwise its mode is set to \fBclose\fR. | |
265 | .IP "\fI$tree\fR\->\fBclose\fR(\fIentryPath\fR)" 4 | |
266 | .IX Item "$tree->close(entryPath)" | |
267 | Close the entry given by \fIentryPath\fR if its \fImode\fR is \fBclose\fR. | |
268 | .IP "\fI$tree\fR\->\fBgetmode\fR(\fIentryPath\fR)" 4 | |
269 | .IX Item "$tree->getmode(entryPath)" | |
270 | Returns the current \fImode\fR of the entry given by \fIentryPath\fR. | |
271 | .IP "\fI$tree\fR\->\fBopen\fR(\fIentryPath\fR)" 4 | |
272 | .IX Item "$tree->open(entryPath)" | |
273 | Open the entry given by \fIentryPath\fR if its \fImode\fR is \fBopen\fR. | |
274 | .IP "\fI$tree\fR\->\fBsetmode\fR(\fIentryPath, mode\fR)" 4 | |
275 | .IX Item "$tree->setmode(entryPath, mode)" | |
276 | This method is used to indicate whether the entry given by | |
277 | \&\fIentryPath\fR has children entries and whether the children are | |
278 | visible. \fImode\fR must be one of \fBopen\fR, | |
279 | \&\fBclose\fR or \fBnone\fR. If \fImode\fR is set to \fBopen\fR, a (+) | |
280 | indicator is drawn next the the entry. If \fImode\fR is set to | |
281 | \&\fBclose\fR, a (\-) indicator is drawn next the the entry. If | |
282 | \&\fImode\fR is set to \fBnone\fR, no indicators will be drawn for this | |
283 | entry. The default \fImode\fR is none. The \fBopen\fR mode indicates | |
284 | the entry has hidden children and this entry can be opened by the | |
285 | user. The \fBclose\fR mode indicates that all the children of the entry | |
286 | are now visible and the entry can be closed by the user. | |
287 | .SH "BINDINGS" | |
288 | .IX Header "BINDINGS" | |
289 | The basic mouse and keyboard bindings of the Tree widget are the same | |
290 | as the bindings of the HList widget. | |
291 | In addition, the entries can be opened or closed under the following | |
292 | conditions: | |
293 | .IP "[1]" 4 | |
294 | .IX Item "[1]" | |
295 | If the \fImode\fR of the entry is \fBopen\fR, it can be opened by clicking | |
296 | on its (+) indicator. | |
297 | .IP "[2]" 4 | |
298 | .IX Item "[2]" | |
299 | If the \fImode\fR of the entry is \fBclose\fR, it can be closed by clicking | |
300 | on its (\-) indicator. | |
301 | .SH "SEE ALSO" | |
302 | .IX Header "SEE ALSO" | |
303 | Tk::HList | |
304 | .SH "AUTHOR" | |
305 | .IX Header "AUTHOR" | |
306 | Perl/TK version by Chris Dean <ctdean@cogit.com>. Original Tcl/Tix | |
307 | version by Ioi Kim Lam. | |
308 | .SH "ACKNOWLEDGEMENTS" | |
309 | .IX Header "ACKNOWLEDGEMENTS" | |
310 | Thanks to Achim Bohnet <ach@mpe.mpg.de> for all his help. |