[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtk
Subject:    Lazy cell renderer
From:       "David Necas (Yeti)" <yeti () physics ! muni ! cz>
Date:       2004-12-23 10:32:26
Message-ID: 20041223103226.GB3408 () potato
[Download RAW message or body]


Hello,

I have a TreeView with lots of rows, one its column is
pixbuf and the pixbufs it displays may need to be loaded
from disk which is quite slow. Moreover, in most cases user
sees only a small fraction of them and then closes the view.
So I want to load the pixbufs only when/if they are actually
exposed.

I set the pixbuf renderer to fixed size and loaded the pixbufs
in cell data func.  Unfortunately, the cell data func was
called for each row when the TreeView was being created, so
all pixbufs had to be loaded before the TreeView was shown
and it was as slow as before.

Since all the unwanted calls to cell data func happen before
the TreeView is realized, my cell data func simply ignores
all calls to it if the TreeView is not realized now.  This
seems to work quite well.  But is it a good idea?  Can I
assume it will work with future Gtk+ versions?

Yeti


--
Dynamic IP address is not a crime.
_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic