Re: Going through a TreeStore



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]