Changes in trunk/python/asaplotgui_qt4.py [2170:2451]
- File:
-
- 1 edited
-
trunk/python/asaplotgui_qt4.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplotgui_qt4.py
r2170 r2451 29 29 30 30 asaplotbase.__init__(self, **v) 31 matplotlib.rcParams["interactive"] = True 31 32 33 _pylab_helpers.Gcf.destroy(0) 32 34 self.canvas = FigureCanvasQTAgg(self.figure) 33 35 # Simply instantiating this is enough to get a working toolbar. 34 self.figmgr = FigureManagerQTAgg(self.canvas, 1)36 self.figmgr = FigureManagerQTAgg(self.canvas, 0) 35 37 self.window = self.figmgr.window 36 38 self._set_window_title('ASAP Plotter - Qt4') 37 # register this plot to matplotlib 38 _pylab_helpers.Gcf.set_active(self.figmgr) 39 # Register this plot to matplotlib without activating it 40 #_pylab_helpers.Gcf.set_active(self.figmgr) 41 _pylab_helpers.Gcf.figs[self.figmgr.num] = self.figmgr 39 42 40 43 ############# … … 49 52 qt.QtCore.QObject.connect(self.window, qt.QtCore.SIGNAL('destroyed()'),dest_callback) 50 53 51 self.events = {'button_press':None,52 'button_release':None,53 'motion_notify':None}54 55 matplotlib.rcParams["interactive"] = True56 self.buffering = buffering57 58 54 self.unmap() 59 55 #self.canvas.show() … … 64 60 window stack. 65 61 """ 62 if self.is_dead: 63 raise RuntimeError( "No plotter to show. Not yet plotted or plotter is closed." ) 66 64 self.window.activateWindow() 67 65 #To raise this window to the top of the stacking order … … 74 72 """ 75 73 self.is_dead = True 76 try: self.window.close() 74 if not self.figmgr: 75 return 76 try: 77 #self.window.close() 78 # TODO destroy casabar 79 _pylab_helpers.Gcf.destroy(self.figmgr.num) 80 del self.window, self.canvas, self.figmgr 81 self.window = None 82 self.canvas = None 83 self.figmgr = None 77 84 except RuntimeError: pass # the window may already be closed by user 78 85 … … 81 88 Show graphics dependent on the current buffering state. 82 89 """ 90 if self.is_dead: 91 raise RuntimeError( "No plotter to show (not yet plotted or closed)." ) 83 92 if not self.buffering: 84 93 if hardrefresh: … … 93 102 Clear the figure. 94 103 """ 104 if not self.window: 105 asaplog.push( "No plotter window to terminate." ) 106 asaplog.post( "WARN" ) 107 return 95 108 self.window.close() 96 109 … … 99 112 Hide the ASAPlot graphics window. 100 113 """ 114 if not self.window: 115 asaplog.push( "No plotter window to unmap." ) 116 asaplog.post( "WARN" ) 117 return 101 118 self.window.hide() 102 119
Note:
See TracChangeset
for help on using the changeset viewer.
