[pygtk] Inconsistent format for "path" in TreeView callbacks

Jason Heeris jason.heeris at gmail.com
Sat May 7 02:43:44 WST 2011


On 7 May 2011 02:30, Neil Muller <drnlmuller+gtk at gmail.com> wrote:
> Are you writing your own TreeModel (using GenericTreeModel) or using
> something like TreeStore?

Using a ListStore.

> I think you really should be using TreeIters rather than paths to
> manage this mapping, since they directly map to rows in the model,
> rather than positions in the treeview which may or may not match rows
> in the model.

I can't map against TreeIters though, since — for example — the
TreeIter returned by "ListStore.append()" is not the same as what
you'd get back by using the path passed in on one of the signals.
Sure, it points to the same row, but since it's not the same object
it's useless as a dict key.

— Jason


More information about the pygtk mailing list