[pygtk] Problems with gtk.TreeIter and reorderable gtk.TreeView

Jamie Bliss astronouth7303 at gmail.com
Tue Sep 13 00:45:27 WST 2011


My suggestion would bet to add a column to the store containing an
opaque, unique ID for each row (not unlike a database). To me, this
seems conceptually simpler then trying to refresh TreeIters.

2011/9/12 Neil Muller <drnlmuller+gtk at gmail.com>:
> I'm pretty sure that moving the row current_track points to will
> invalidate the gtk.TreeIter you have, as the row gets deleted and
> re-created elsewhere, which would be why you're seeing None for the
> path. You should be able to check if this is the case  by using
> ListStore.iter_is_valid().

I was wondering the same thing, since TreeIter lifespans can be less
than useful in some models. But the docs (and the flags) indicate that
TreeIters survive changes.

Of course, if you're right about it deleting and inserting (which you
probably are), it doesn't matter.

> I would add some logic to the drag_data_received signal to deal with this case.

Pardon my n00bishness, but isn't tree-row-drag code part of GTK and
not the application?


More information about the pygtk mailing list