Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Can now select data in navigator by single-clicking or moving with keyboard, no need to activate (double-click etc.).

This commit is contained in:
Truls Alexander Tangstad 2006-04-21 14:29:08 +00:00
parent 07ac564668
commit f3a65a3c4f
1 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@ class NavigatorView (gtk.TreeView):
gtk.TreeView.__init__(self, self.data_tree)
self.set_headers_visible(False)
self.connect('row-activated', self.row_activated_handler)
self.connect('cursor_changed', self.cursor_changed_handler)
renderer = gtk.CellRendererText()
self.object_col = gtk.TreeViewColumn('Object', renderer, text=0)
@ -23,9 +23,11 @@ class NavigatorView (gtk.TreeView):
logger.log('debug', 'Initializing navigator window.')
def row_activated_handler(self, widget, path, column):
iter = self.data_tree.get_iter(path)
obj = self.data_tree.get_value(iter, 2)
def cursor_changed_handler(self, widget):
selection = widget.get_selection()
model, tree_iter = selection.get_selected()
obj = self.data_tree.get_value(tree_iter, 2)
if isinstance(obj, plots.Plot):
logger.log('debug', 'Activating plot')
self.app.change_plot(obj)