Re: Going through a TreeStore



I promise this time it works :)
This is a TESTED version from my program:

my $next=$store->get_iter_first;
while (my $iter=$next)
{       if ( $next=$store->iter_children($iter) )
        {       # non-leaf, do something
        }
        else    #leaf
        {       $next=$store->iter_next($iter);
                #do something
        }
        # $next is undef if there is no child or next brother
        #  then go up until you find a parent which has a next brother
        until ($next)
        {       last unless $iter=$store->iter_parent($iter);
                $next=$store->iter_next($iter);
        }
}

-- 
Quentin Sculo <squentin free fr>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]