Re: gtk.TreeModel.iter_children() method, how often should it be called?



Hi.

> 1. Is this normal (I hope not!) behavior?

I'm not sure about 1000, but calling this function a lot is normal if
you make major changes to your model while attached to GtkTreeView.

> 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 before displaying the tree?

Try detaching model from tree view before doing any major change.
Sample code would look something like this (in C):
------------ CODE -----------
model = gtk_tree_view_get_model( GTK_TREE_VIEW( tree ) );
g_object_ref( G_OBJECT( model ) );
gtk_tree_view_set_model( GTK_TREE_VIEW( tree ), NULL );

/* Make changes */

gtk_tree_view_set_model( GTK_TREE_VIEW( tree ), model );
g_object_unref( G_OBJECT( model ) );
------------ /CODE -------------

Hope this helps.

-- 
Tadej Borovšak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]