Changeset 1153 for trunk/python/asaplotgui_gtk.py
- Timestamp:
- 08/21/06 10:48:45 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplotgui_gtk.py
r1089 r1153 8 8 import matplotlib 9 9 from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas 10 from matplotlib.backends.backend_gtkagg import FigureManagerGTKAgg 10 11 matplotlib.use("GTkAgg") 11 12 matplotlib.rcParams['toolbar'] = 'toolbar2' 13 from matplotlib.backends.backend_gtk import NavigationToolbar2GTK as NavigationToolbar 12 14 13 15 class asaplotgui(asaplotbase): … … 27 29 28 30 asaplotbase.__init__(self, **v) 29 self.window = gtk.Window() 31 matplotlib.interactive = True 32 self.canvas = FigureCanvas(self.figure) 33 # Simply instantiating this is enough to get a working toolbar. 34 self.figmgr = FigureManagerGTKAgg(self.canvas, 1) 30 35 def dest_callback(val): 31 36 self.is_dead = True 32 self.window.destroy() 37 self.figmgr.window.destroy() 38 self.window = self.figmgr.window 33 39 self.window.connect("destroy", dest_callback ) 34 self.window.set_default_size(800,600) 35 self.subwin = gtk.ScrolledWindow() 36 self.window.add(self.subwin) 37 self.subwin.set_border_width(10) 38 self.canvas = FigureCanvas(self.figure) 39 # Simply instantiating this is enough to get a working toolbar. 40 self.figmgr = None#FigureManagerTkAgg(self.canvas, 1, self.window) 41 self.window.set_title('ASAPlot graphics window') 42 40 self.window.set_title('ASAP Plotter - GTK') 43 41 self.events = {'button_press':None, 44 42 'button_release':None, 45 43 'motion_notify':None} 46 44 47 self.subwin.add_with_viewport(self.canvas)48 matplotlib.interactive = True49 45 self.buffering = buffering 50 self.canvas.set_size_request(800,600) 51 52 self.canvas.show() 46 matplotlib.rcParams['interactive'] = True 47 #self.canvas.set_size_request(800,600) 48 49 #self.canvas.show() 53 50 54 51 def map(self): … … 180 177 181 178 182 def show(self ):179 def show(self, hardrefresh=True): 183 180 """ 184 181 Show graphics dependent on the current buffering state. 185 182 """ 186 183 if not self.buffering: 187 asaplotbase.show(self) 184 if hardrefresh: 185 asaplotbase.show(self, hardrefresh) 188 186 self.window.deiconify() 189 187 self.canvas.draw()
Note: See TracChangeset
for help on using the changeset viewer.