Selections are selected when a row is activated. Identifiers are updated when cursor-changed is called.
This commit is contained in:
parent
fc21c58ab3
commit
026dc639e3
|
@ -30,6 +30,7 @@ class SelectionTree(gtk.TreeView):
|
|||
self.insert_column(sel_column, 0)
|
||||
|
||||
self.connect('row-activated', self._on_row_activated)
|
||||
self.connect('cursor-changed', self._on_cursor_changed)
|
||||
|
||||
self._identifier_list = None
|
||||
self._dim_list = {}
|
||||
|
@ -111,15 +112,20 @@ class SelectionTree(gtk.TreeView):
|
|||
|
||||
# Callbacks
|
||||
def _on_row_activated(self, treeview, path, column):
|
||||
i = self.store.get_iter(path)
|
||||
self.project.set_selection(self._current_dim,
|
||||
self._current_selection[self._current_dim])
|
||||
|
||||
def _on_cursor_changed(self, treeview):
|
||||
cursor = self.get_cursor()[0]
|
||||
i = self.store.get_iter(cursor)
|
||||
p = self.store.iter_parent(i)
|
||||
if p == None:
|
||||
pass
|
||||
self._current_selection = None
|
||||
else:
|
||||
self._current_dim = self.store.get_value(p, 0)
|
||||
self._current_selection = self.store.get_value(i, 1)
|
||||
self._update_current_dim()
|
||||
|
||||
|
||||
def _on_set_selection(self, *rest):
|
||||
if not self._current_selection:
|
||||
return
|
||||
|
|
Reference in New Issue