RE: GtkListStore



On Wed, 2003-04-23 at 05:15, martyn 2 russell bt com wrote:
 I am confused by this statement :
"Additionally, some models guarantee that an iterator is 
valid for as long as
the node it refers to is valid (most notably the GtkTreeStore and
GtkListStore)" (GtkTreeModel doc).


  Does it mean that I can store/save the interator in my 
application and use it
later to access the data ? ( Even if I delete/add rows ? )

I wouldn't recommend it.  What happens if you store it and the thing it
points to gets deleted? or moved? I *THINK* that at that point the iterator
becomes invalid, but even if it doesnt and you use it, you will not be
pointing at what you expect to be pointing at.

I agree with you though, the documentation is not very clear when it
introduces phrases like "... some models ...".  To me this sounds like they
mean, "...depending on how the model is implemented..." - I could be wrong.

Regards,
Martyn

FWIW, in an earlier implementation of a program im writing, I stored the
iterators, expecting them to become invalid, but they remain valid even
after at least inserting rows, not sure about removing (havent tried).

YMMV.

Mike




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