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:
parent
07ac564668
commit
f3a65a3c4f
|
@ -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)
|
||||
|
|
Reference in New Issue