diff --git a/system/navigator.py b/system/navigator.py index cd6c12e..a5ebf42 100644 --- a/system/navigator.py +++ b/system/navigator.py @@ -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)