[pygtk] How do I get the previous gtk.TreeIter in a TreeModel?
Rich Burridge
Rich.Burridge at Sun.COM
Sun Jun 10 02:42:02 WST 2007
Hi,
Hopefully I'm missing something obvious.
Given a gtk.TreeIter in a gtk.TreeModel, from:
http://www.pygtk.org/docs/pygtk/class-gtktreemodel.html#method-gtktreemodel--iter-next
I can see how to get the gtk.TreeIter pointing to the next row.
But how to I get a gtk.TreeIter pointing to the previous row?
Just in case I'm taking the wrong approach here, what I want to do is move
one (or more) selected rows, up one row.
I was expecting the code for the callback for the "Move up one" button
to be something like:
def textMoveUpOneButtonClicked(self, widget):
textSelection = self.getTextAttributesView.get_selection()
[model, paths] = textSelection.get_selected_rows()
for path in paths:
iter = model.get_iter(path)
prevIter = model.iter_prev(iter)
model.swap(iter, prevIter)
but there is no gtk.TreeMode.iter_prev() function.
More information about the pygtk
mailing list