[pygtk] gtk.TreeModel.iter_children() method, how often should it be called?

Gerald Britton gerald.britton at gmail.com
Sun Jun 21 06:11:41 WST 2009

I hear you, but I still need a direct answer to the question, "What
makes the TreeModel stop calling iter_children?  I can't find a clear
explanation and I can't figure it out by looking at the calls that
come into my method either.

On Thu, Jun 18, 2009 at 11:18 AM, Chris Camacho<chris_camacho at yahoo.com> wrote:
> jeeze not being able to just reply is a pain anyhow....
> I looked into using treemodels connecting to databases
> from what I could tell it seems to initially iterate all items
> and either copies them or creates meta data about the items
> (I didnt look into the implementation)
> Depending on how things were added it would also seem to iterate the whole
> set again!
> I think the standard treemodel is ok for small numbers (sub 200)
> but I had to end up paging 1,000's of items 100 at a time
> (interestingly this is what the gnome db widgets do...)
> I've been tempted to weld together my own data grid with a viewport
> and moving entry widgets but this would at a guess need C and I haven't
> had the time to look into it
> --- On Thu, 18/6/09, Gerald Britton <gerald.britton at gmail.com> wrote:
>> From: Gerald Britton <gerald.britton at gmail.com>
>> Subject: [pygtk] gtk.TreeModel.iter_children() method, how often should it be called?
>> To: pygtk at daa.com.au
>> Date: Thursday, 18 June, 2009, 2:50 PM
>> Hi -- I think I have a problem but
>> I'm not sure since I'm relatively
>> new to the TreeModel and how it works.  Here's the
>> scenario:
>> I use TreeModel to display rows of data from a
>> database.  Upon
>> startup, the TreeModel is built and I notice two calls to
>> the
>> gtk.TreeModel.iter_children() method.  Later, I change
>> some data in
>> one of the rows.  The next time the TreeModel is
>> built,
>> gtk.TreeModel.iter_children() is called thousands of times
>> before the
>> display is refreshed. Oh, the database has less than 50
>> rows of data
>> in it!
>> So, two questions:
>> 1. Is this normal (I hope not!) behavior?
>> 2. What tells the TreeModel to stop calling
>> gtk.TreeModel.iter_children()?  How does the TM know
>> that it has done
>> everything it needs to do?
>> --
>> Gerald Britton
>> _______________________________________________
>> pygtk mailing list   pygtk at daa.com.au
>> http://www.daa.com.au/mailman/listinfo/pygtk
>> Read the PyGTK FAQ: http://faq.pygtk.org/

Gerald Britton

More information about the pygtk mailing list