Changeset 2416 for trunk/python
- Timestamp:
- 02/21/12 14:11:09 (13 years ago)
- Location:
- trunk/python
- Files:
-
- 4 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): -
trunk/python/asaplotgui_qt4.py
r2170 r2416 32 32 self.canvas = FigureCanvasQTAgg(self.figure) 33 33 # Simply instantiating this is enough to get a working toolbar. 34 self.figmgr = FigureManagerQTAgg(self.canvas, 1)34 self.figmgr = FigureManagerQTAgg(self.canvas, 0) 35 35 self.window = self.figmgr.window 36 36 self._set_window_title('ASAP Plotter - Qt4') 37 # register this plot to matplotlib 38 _pylab_helpers.Gcf.set_active(self.figmgr) 37 # Register this plot to matplotlib without activating it 38 #_pylab_helpers.Gcf.set_active(self.figmgr) 39 _pylab_helpers.Gcf.figs[self.figmgr.num] = self.figmgr 39 40 40 41 ############# -
trunk/python/asapplotter.py
r2290 r2416 1256 1256 PL.ion() 1257 1257 PL.draw() 1258 PL.gcf().show()1258 if matplotlib.get_backend() == 'Qt4Agg': PL.gcf().show() 1259 1259 if (self._outfile is not None): 1260 1260 PL.savefig(self._outfile) … … 1295 1295 [xmin,xmax,ymin,ymax] = PL.axis() 1296 1296 PL.axis([xmax,xmin,ymin,ymax]) 1297 #PL.ion()1297 PL.ion() 1298 1298 PL.draw() 1299 PL.gcf().show()1299 if matplotlib.get_backend() == 'Qt4Agg': PL.gcf().show() 1300 1300 if (self._outfile is not None): 1301 1301 PL.savefig(self._outfile) -
trunk/python/customgui_tkagg.py
r2174 r2416 135 135 self.disable_button() 136 136 self.figmgr.window.wm_withdraw() 137 self._p.quit() 137 138 138 139 def enable_button(self): … … 147 148 #self.bSpec.config(relief='raised', state=Tk.DISABLED) 148 149 self.bStat.config(relief='raised', state=Tk.DISABLED) 149 #self.bNext.config(state=Tk.DISABLED)150 #self.bPrev.config(state=Tk.DISABLED)150 self.bNext.config(state=Tk.DISABLED) 151 self.bPrev.config(state=Tk.DISABLED) 151 152 self.button = False 152 153 self.mode = '' … … 647 648 self.disable_button() 648 649 self.figmgr.window.wm_withdraw() 650 self._p.quit() 649 651 650 652 def enable_button(self):
Note:
See TracChangeset
for help on using the changeset viewer.