Re: GtkListStore



martyn 2 russell bt com writes:

You can keep the Iter around and access it for the life of 
the row with
a GtkListStore.  Once the row has been deleted, you had better get rid
of it.

What about if the row is moved to a different parent for example, is it
still valid then?

How did you move it?  If you moved it be adding another row and removing
the older row, then of course not.

It depends on whether or not the model has the GTK_TREE_ITERS_PERSIST
flag set or not.

Can you elaborate, what exactly does this do? (GTK_TREE_ITERS_PERSIST) - or
what does it do if it is not set?

if (gtk_tree_model_get_flags (model) & GTK_TREE_ITERS_PERSIST) is TRUE,
then we know that the iter will stay valid as long as that row (or one
of it's parents) isn't deleted.  This means that subsequent signals on
the model of "inserted", "reordered" and "changed" don't invalidate the
iter at all.  The iter will also survive a call to "deleted" so long
neither the row nor it's parents are deleted.

-Jonathan



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