Changeset 2416 for trunk/python/asaplotgui.py
- Timestamp:
- 02/21/12 14:11:09 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplotgui.py
r2170 r2416 10 10 # Force use of the newfangled toolbar. 11 11 matplotlib.rcParams['toolbar'] = 'toolbar2' 12 from matplotlib import _pylab_helpers 12 13 13 14 class asaplotgui(asaplotbase): … … 28 29 asaplotbase.__init__(self, **v) 29 30 self.window = Tk.Tk() 30 def dest_callback(): 31 self.is_dead = True 32 self.window.destroy() 31 #def dest_callback(): 32 # print "dest_callback" 33 # self.is_dead = True 34 # self.window.destroy() 33 35 34 self.window.protocol("WM_DELETE_WINDOW", dest_callback)36 self.window.protocol("WM_DELETE_WINDOW", self.quit) 35 37 self.canvas = FigureCanvasTkAgg(self.figure, master=self.window) 36 38 self.canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) 37 39 # Simply instantiating this is enough to get a working toolbar. 38 self.figmgr = FigureManagerTkAgg(self.canvas, 1, self.window) 40 self.figmgr = FigureManagerTkAgg(self.canvas, 0, self.window) 41 # Register this plot to matplotlib without activating it 42 #_pylab_helpers.Gcf.set_active(self.figmgr) 43 _pylab_helpers.Gcf.figs[self.figmgr.num] = self.figmgr 39 44 self._set_window_title('ASAP Plotter - Tk') 40 45 … … 61 66 """ 62 67 self.is_dead = True 63 self.window.destroy() 68 #self.window.destroy() 69 _pylab_helpers.Gcf.destroy(self.figmgr.num) 70 del self.window, self.canvas 71 self.window = None 72 self.canvas = None 73 64 74 65 75 def show(self, hardrefresh=True):
Note: See TracChangeset
for help on using the changeset viewer.