Re: Going through a TreeStore
- From: Quentin Sculo <squentin free fr>
- To: Florian Schaefer <listbox netego de>
- Cc: Gtk-Perl <gtk-perl-list gnome org>
- Subject: Re: Going through a TreeStore
- Date: Wed, 19 May 2004 15:48:41 +0200
How about this (quickly modified from something i wrote):
my @next;
my $iter=$store->get_iter_first;
#or $iter of the root of the branch to iterate
while ($iter)
{ my (@rowdata)=$store->get($iter);
if ( $store->iter_n_children($iter) )
{ # going down one level
unshift @next,$store->get_string_from_iter($iter);
$iter=$store->iter_children($iter);
}
else # leaf
{ $iter=$store->iter_next($iter);
}
until ($iter)
{ #going up one level
last unless $_=shift @next;
$iter=$store->iter_next( $store->get_iter_from_string($_) );
}
}
--
Quentin Sculo <squentin free fr>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]