Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

Added selection listeners to plots in context menu

This commit is contained in:
Arnar Flatberg 2007-02-26 07:58:33 +00:00
parent a614908436
commit 3ee8439e07
1 changed files with 10 additions and 4 deletions

View File

@ -18,10 +18,10 @@ class NavigatorView (gtk.TreeView):
gtk.TreeView.__init__(self)
# various properties
self.set_enable_tree_lines(True)
#self.set_enable_tree_lines(True)
self.set_headers_visible(False)
self.get_hadjustment().set_value(0)
self.set_enable_tree_lines(True)
# Selection Mode
self.get_selection().set_mode(gtk.SELECTION_MULTIPLE)
@ -183,7 +183,7 @@ class NavigatorView (gtk.TreeView):
class NavigatorMenu(gtk.Menu):
def __init__(self, navigator):
gtk.Menu.__init__(self)
self.navigaotor = navigator
self.navigator = navigator
self.dataset = None
self.tree_iter = None
@ -277,9 +277,15 @@ class NavigatorMenu(gtk.Menu):
plot = plots.ImagePlot(self.dataset, name='Image Plot')
icon = fluents.icon_factory.get("line_plot")
project.data_tree_insert(self.tree_iter, 'Image Plot', plot, None, "black", icon)
# fixme: image plot selections are not well defined
#plot.set_selection_listener(project.set_selection)
#project._selection_observers.append(plot)
def on_plot_hist(self, item, navigator):
project = navigator.project
plot = plots.HistogramPlot(self.dataset, name='Histogram')
icon = fluents.icon_factory.get("line_plot")
project.data_tree_insert(self.tree_iter, 'Histogram', plot, None, "black", icon)
plot.set_selection_listener(project.set_selection)
project._selection_observers.append(plot)