logo       

RE: liststore update question: msg#00230

Subject: RE: liststore update question
Thanks,
Would storing TreeRowReference's be faster than
using:

    my $iter = $model->get_iter_first;
    while (defined $iter)
     {
       ....
       $iter = $model->iter_next($iter);
     }
-----Original Message-----
From: gtk-perl-list-admin@xxxxxxxxx
[mailto:gtk-perl-list-admin@xxxxxxxxx] On Behalf Of muppet
Sent: Monday, March 29, 2004 3:25 PM
To: gtk-perl-list@xxxxxxxxx
Subject: Re: liststore update question



B McAndrews said:
> I have liststore setup with an appropriate view. The model was 
> initially set with data from database.  I can get updates from the 
> database, but I'm unsure as to how I go about updating the model and 
> subsequently the view.  Rows won't be added or deleted, so I thought 
> of something I could cache the iterators that were created at 
> initialization, but I'm not sure that would work.  Can anyone  help me

> here?

The iters are not guaranteed long lifetimes, so you do not want to cache
them.  Instead, you'd use a Gtk2::TreeRowReference, which is guaranteed
to point to the right place, even if the data in the list changes, so
long as the row exists.

http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeModel.html#gtk-tree-ro
w-reference-new
and http://gtk2-perl.sourceforge.net/doc/pod/Gtk2/TreeRowReference.html


After that, as far as i know, when you do

  $model->set ($iter, COL1 $val1, COL2, $val2, ...);

the view should update automatically, with no intervention from you.  In
fact, i've been looking for a way to freeze/thaw the liststore during
large updates; i think $object->freeze_notify and thaw_notify are
supposed to work here.

-- 
muppet <scott at asofyet dot org>
_______________________________________________
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