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.insert_column(sel_column, 0)
|
||||||
|
|
||||||
self.connect('row-activated', self._on_row_activated)
|
self.connect('row-activated', self._on_row_activated)
|
||||||
|
self.connect('cursor-changed', self._on_cursor_changed)
|
||||||
|
|
||||||
self._identifier_list = None
|
self._identifier_list = None
|
||||||
self._dim_list = {}
|
self._dim_list = {}
|
||||||
|
@ -111,10 +112,15 @@ class SelectionTree(gtk.TreeView):
|
||||||
|
|
||||||
# Callbacks
|
# Callbacks
|
||||||
def _on_row_activated(self, treeview, path, column):
|
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)
|
p = self.store.iter_parent(i)
|
||||||
if p == None:
|
if p == None:
|
||||||
pass
|
self._current_selection = None
|
||||||
else:
|
else:
|
||||||
self._current_dim = self.store.get_value(p, 0)
|
self._current_dim = self.store.get_value(p, 0)
|
||||||
self._current_selection = self.store.get_value(i, 1)
|
self._current_selection = self.store.get_value(i, 1)
|
||||||
|
|
Reference in New Issue