Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0
This commit is contained in:
Einar Ryeng 2006-08-31 13:27:58 +00:00
parent f47a9066e3
commit a6186d7cb6
2 changed files with 10 additions and 7 deletions

View File

@ -81,12 +81,13 @@ class FluentApp:
self.init_gui() self.init_gui()
def change_plot(self, plot): def change_plot(self, plot):
"""Sets the plot in the currently active ViewFrame. If the plot is already """Sets the plot in the currently active ViewFrame. If the plot is
shown in another ViewFrame it will be moved from there.""" already shown in another ViewFrame it will be moved from there."""
# Set current selection in the plot before showing it. # Set current selection in the plot before showing it.
plot.selection_changed(self.project.get_selection()) 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): def change_plots(self, plots):
"""Changes all plots.""" """Changes all plots."""
@ -96,7 +97,8 @@ class FluentApp:
return self['main_view'].get_active_view_frame() return self['main_view'].get_active_view_frame()
def _update_toolbar(self, view): 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 # don't do anything on no change
if self._last_view == view: if self._last_view == view:
@ -105,7 +107,7 @@ class FluentApp:
logger.log("debug", "view changed to %s" % view) 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: if self._plot_toolbar:
window.remove(self._plot_toolbar) window.remove(self._plot_toolbar)

View File

@ -12,7 +12,7 @@ from matplotlib.numerix import arange, sin, pi
from matplotlib.widgets import RectangleSelector from matplotlib.widgets import RectangleSelector
from matplotlib import cm from matplotlib import cm
import networkx import networkx
from system import logger from system import logger
class ObjectTable: class ObjectTable:
@ -149,6 +149,7 @@ class ViewFrame (gtk.Frame):
obj = treestore.get_value(iter,2) obj = treestore.get_value(iter,2)
if isinstance(obj, Plot): if isinstance(obj, Plot):
self.set_view(obj) self.set_view(obj)
self.focus()
class MainView (gtk.Notebook): class MainView (gtk.Notebook):