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