Added histogram in plot menu

This commit is contained in:
Arnar Flatberg 2007-01-17 15:40:54 +00:00
parent 7c20e6d780
commit f533344242

View File

@ -18,6 +18,7 @@ class NavigatorView (gtk.TreeView):
gtk.TreeView.__init__(self)
# various properties
self.set_enable_tree_lines(True)
self.set_headers_visible(False)
self.get_hadjustment().set_value(0)
self.set_enable_tree_lines(True)
@ -205,6 +206,11 @@ class NavigatorMenu(gtk.Menu):
self.plot_menu.append(self.plot_image_item)
self.plot_image_item.show()
self.plot_hist_item = gtk.MenuItem('Histogram')
self.plot_hist_item.connect('activate', self.on_plot_hist, navigator)
self.plot_menu.append(self.plot_hist_item)
self.plot_hist_item.show()
self.plot_item = gtk.MenuItem('Plot')
self.append(self.plot_item)
self.plot_item.set_submenu(self.plot_menu)
@ -272,4 +278,8 @@ class NavigatorMenu(gtk.Menu):
icon = fluents.icon_factory.get("line_plot")
project.data_tree_insert(self.tree_iter, 'Image Plot', plot, None, "black", icon)
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)