I have a Gtk.ListStore
model filled with titles and author information, and I want the user to be able to move the elements around to put them in any order they choose. This means providing "Move Up" and "Move Down" buttons.
Unfortunately, the logic I found in this question isn't cooperating with a Gtk.TreeView
that allows multiple elements to be selected.
Gtk.TreeSelection.get_selected()
returns a tuple that contains a Gtk.TreeIter
that points to the single, currently-selected row, but Gtk.TreeSelection.get_selected_rows()
returns a tuple that contains a list of Gtk.TreePath
elements.
The answer given to the single-selected-row question linked to above only works with Gtk.TreeIter
objects, and I haven't been able to figure out how to convert a Gtk.TreePath
into a Gtk.TreeIter
object.
I did, however, find the Gtk.ListStore.move_above(iter, position)
and Gtk.ListStore.move_below(iter, position)
methods, but again, they require Gtk.TreeIter
objects to work.
Am I missing something completely obvious to anyone else?