Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Selections are selected when a row is activated. Identifiers are updated when cursor-changed is called.

This commit is contained in:
Einar Ryeng 2006-08-30 11:36:30 +00:00
parent fc21c58ab3
commit 026dc639e3
1 changed files with 9 additions and 3 deletions

View File

@ -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,10 +112,15 @@ 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)