From a6186d7cb67e9825a614a0e52efae029d6c333ad Mon Sep 17 00:00:00 2001 From: einarr Date: Thu, 31 Aug 2006 13:27:58 +0000 Subject: [PATCH] Closes #15 --- system/fluents.py | 14 ++++++++------ system/plots.py | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/system/fluents.py b/system/fluents.py index 9e2849e..3e68437 100755 --- a/system/fluents.py +++ b/system/fluents.py @@ -81,12 +81,13 @@ class FluentApp: self.init_gui() def change_plot(self, plot): - """Sets the plot in the currently active ViewFrame. If the plot is already - shown in another ViewFrame it will be moved from there.""" + """Sets the plot in the currently active ViewFrame. If the plot is + already shown in another ViewFrame it will be moved from there.""" # Set current selection in the plot before showing it. plot.selection_changed(self.project.get_selection()) - pt = self.widget_tree.get_widget('main_view') - pt.insert_view(plot) + + self['main_view'].insert_view(plot) + self._update_toolbar(plot) def change_plots(self, plots): """Changes all plots.""" @@ -96,7 +97,8 @@ class FluentApp: return self['main_view'].get_active_view_frame() def _update_toolbar(self, view): - "Set the plot specific toolbar to the toolbar of the currently active plot." + """Set the plot specific toolbar to the toolbar of the currently + active plot.""" # don't do anything on no change if self._last_view == view: @@ -105,7 +107,7 @@ class FluentApp: logger.log("debug", "view changed to %s" % view) - window = self.widget_tree.get_widget('plot_toolbar_dock') + window = self['plot_toolbar_dock'] if self._plot_toolbar: window.remove(self._plot_toolbar) diff --git a/system/plots.py b/system/plots.py index 1f13e73..8a176bc 100644 --- a/system/plots.py +++ b/system/plots.py @@ -12,7 +12,7 @@ from matplotlib.numerix import arange, sin, pi from matplotlib.widgets import RectangleSelector from matplotlib import cm import networkx -from system import logger +from system import logger class ObjectTable: @@ -149,6 +149,7 @@ class ViewFrame (gtk.Frame): obj = treestore.get_value(iter,2) if isinstance(obj, Plot): self.set_view(obj) + self.focus() class MainView (gtk.Notebook):