From 026dc639e34f6a17ba813baa83af0e497b2ae9f6 Mon Sep 17 00:00:00 2001 From: einarr Date: Wed, 30 Aug 2006 11:36:30 +0000 Subject: [PATCH] Selections are selected when a row is activated. Identifiers are updated when cursor-changed is called. --- system/selections.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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