~ubuntu-branches/ubuntu/lucid/perl-tk/lucid

« back to all changes in this revision

Viewing changes to pod/Tree.pod

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2008-02-15 13:56:59 UTC
  • mfrom: (1.1.3 upstream) (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080215135659-ru2oqlykuju20fav
Tags: 1:804.028-1
* New Upstream Release (Closes: #463080).
* Update to Debhelper v5.
* Build with XFT=1 (Closes: #411129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
 
138
138
=over 4
139
139
 
 
140
=item I<$tree-E<gt>>B<add_pathimage>(I<treeRegExp [, openImg, closeImg]>)
 
141
 
 
142
This method defines images for a given path (images must be in xpm
 
143
format). The path can be determined by a simplified regular
 
144
expression. There are just three metasymbols:
 
145
 
 
146
=over
 
147
 
 
148
=item ^
 
149
 
 
150
at the beginning of the C<treeRegExp> same as in Perl regular
 
151
expressions
 
152
 
 
153
=item *
 
154
 
 
155
anything
 
156
 
 
157
=item $
 
158
 
 
159
at the end of the C<TreeRegExp>, the same as in Perl regular
 
160
expressions
 
161
 
 
162
=back
 
163
 
 
164
Examples:
 
165
  
 
166
  $tree->add_pathimage('^root','openfolder','folder');
 
167
  
 
168
matches C<root>, C<root.foo>, C<root.bar>, but not C<foo.root>
 
169
 
 
170
  $tree->add_pathimage('root.*.class','openfolder','folder');
 
171
  
 
172
matches all paths containing C<< root.<anything>.class >>, but not
 
173
C<< root.<anything>.<anything>.class >> C<*> is one part of the path. If
 
174
you want to use a wildcard for two steps, you have to use C<*.*>.
 
175
 
 
176
  $tree->add_pathimage('class$','openfolder','folder');
 
177
  
 
178
This matches all path with C<class> at the end.
 
179
 
140
180
=item I<$tree>-E<gt>B<autosetmode>
141
181
 
142
182
This method calls the B<setmode> method for all the entries in
144
184
B<none>. Otherwise, if the entry has any hidden child entries, its
145
185
mode is set to B<open>; otherwise its mode is set to B<close>.
146
186
 
 
187
=item I<$tree-E<gt>>B<child_entries>([$path][,$depth])
 
188
 
 
189
This method returns in list context an array that contains all
 
190
pathnames of subentries within the given path. In scalar context it
 
191
returns the number of subentries in the given path.
 
192
 
 
193
  Example:
 
194
    root
 
195
     | foo
 
196
     | bar
 
197
     |  | bar1
 
198
     |  | bar2
 
199
 
 
200
  my @childentries = $tree->child_entries('root.bar');
 
201
  # returns (root.bar.bar1, root.bar.bar2)
 
202
  
 
203
  my $nr_of_subentries = $tree->child_entries('root',2);
 
204
  # returns 4
 
205
 
 
206
If C<$path> is omitted, all it is assumed, that the entry above
 
207
'root' is meant. C<$depth> defines the numbers of levels.
 
208
 
147
209
=item I<$tree>-E<gt>B<close>(I<entryPath>)
148
210
 
149
211
Close the entry given by I<entryPath> if its I<mode> is B<close>.
202
264
Perl/TK version by Chris Dean <ctdean@cogit.com>.  Original Tcl/Tix
203
265
version by Ioi Kim Lam.
204
266
 
 
267
Additions by Renee Baecker <module@renee-baecker.de>
 
268
 
205
269
=head1 ACKNOWLEDGEMENTS
206
270
 
207
271
Thanks to Achim Bohnet <ach@mpe.mpg.de> for all his help.