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