logo       

Re: Going through a TreeStore: msg#00122

Subject: Re: Going through a TreeStore
Hi Quentin,

thanks for your responses.

On Wed, 19 May 2004 16:31:34 +0200, Quentin Sculo said:

>This time it should be right :) :

Hmpf, before I can comment on that, I suppose, I have to understand your
code. ;-) OK, let's see what I make out of this and please tell me if I'm
wrong somewhere.

> my $iter=$store->get_iter_first;      # or starting point

Easy, let's start with the first iterator.

> while ($iter)

Do the stuff only if the last $iter is not undef.

> {     # do something

This would be my check for i.e. a special property.

>       $iter=( $store->iter_children($iter)||$store->iter_next($iter) );

My next $iter is either the cild or, if there is no child, just the next
one.

>       unless ($iter)

Do the next thing, only if $iter is undefined, that is, if the next $iter
got us nowhere.

>       {       $iter=$store->iter_next($_) while

Here things start to get unclear. Who sets $_ to what here?

>                       $_=$store->iter_parent($iter);

Oh, ok, I see, I really have to get used that you can write the reactio
before the actio in Perl. ;-)

Then this has to mean: Set $_ to the iter_parent as often as possible and
afterward $iter will hold the iter of the "toplevel parent".

>       }
> }

Wow, if my understanding is correct, I can go through a tree starting
somewhere handling the problems when starting at a child level and not
using a single recursion. Sounds good. :-)

Ciao
Florian

Attachment: pgpg2rjVwfpZu.pgp
Description: PGP signature

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe