diff --git a/system/selections.py b/system/selections.py index cb51fdd..90d4ead 100644 --- a/system/selections.py +++ b/system/selections.py @@ -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