On Friday 26 September 2003 12:10 pm, Michal Pasternak wrote:
> Gary Herron [Wed, Sep 24, 2003 at 10:14:54PM -0700]:
> > On Wednesday 24 September 2003 11:45 pm, Michal Pasternak wrote:
> > > Hi,
> > >
> > > do you know about any tips or documentation about using GTK widgets
> > > to display large amounts of data?
> > >
> > > I have some TreeViews (both TreeStore and ListStore), to which I have
> > > to insert a lot of data. Well, the scrolling seems fast enough, but the
> > > insertion of the data lasts some time. Aren't there any tips and tricks
> > > to make it a bit faster / less memory-consuming?
> >
> > Yes.  Use the more general TreeModel class.
>
> Well, I did. As I have been debugging, the TreeView requests only the
> values of the visible rows from the model - which is just fine - but just
> after TreeView.set_model my TreeView scans _all_ the rows of the model, 2
> times.
>
> Well, I thought that this might be because of the columns auto-sizing
> option. I did set_size(gtk.TREE_VIEW_COLUMN_FIXED) on all columns. Still
> the same behaviour. How could I get around it? I don't want the TreeView to
> "scan" throught rows in my model when those rows are not visible, because
> it takes much time.


Well now you've gone beyond my knowledge of TreeView's, but I think
there is hope.  I remember an example where the children are not even
added to a TreeStore until their parent row is expanded, so certainly
no time could be wasted traversing them at start up time.  Perhaps you
can apply something similar to your TreeModel.  

The example is in the PyGtk FAQ:

  http://www.async.com.br/faq/pygtk/index.py?req=show&file=faq13.030.htp

Good luck,
Gary Herron



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to