Skip to content

Instantly share code, notes, and snippets.

@np1
Last active December 17, 2015 18:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save np1/5653451 to your computer and use it in GitHub Desktop.
Save np1/5653451 to your computer and use it in GitHub Desktop.
Gtk get tree selection rownumber and contents #Python #Gtk #Treeview
def on_tree_selection_changed(self, selection):
model, treeiter = selection.get_selected()
if treeiter is not None:
rowcontents = model[treeiter][0:3] # for a 4 column treeview
rownumobj = model.get_path(treeiter)
rownum = int(rownumobj.to_string())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment