Changeset 2451 for trunk/python/asaplotgui_qt4.py
- Timestamp:
- 03/30/12 19:58:59 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asaplotgui_qt4.py
r2416 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. … … 50 52 qt.QtCore.QObject.connect(self.window, qt.QtCore.SIGNAL('destroyed()'),dest_callback) 51 53 52 self.events = {'button_press':None,53 'button_release':None,54 'motion_notify':None}55 56 matplotlib.rcParams["interactive"] = True57 self.buffering = buffering58 59 54 self.unmap() 60 55 #self.canvas.show() … … 65 60 window stack. 66 61 """ 62 if self.is_dead: 63 raise RuntimeError( "No plotter to show. Not yet plotted or plotter is closed." ) 67 64 self.window.activateWindow() 68 65 #To raise this window to the top of the stacking order … … 75 72 """ 76 73 self.is_dead = True 77 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 78 84 except RuntimeError: pass # the window may already be closed by user 79 85 … … 82 88 Show graphics dependent on the current buffering state. 83 89 """ 90 if self.is_dead: 91 raise RuntimeError( "No plotter to show (not yet plotted or closed)." ) 84 92 if not self.buffering: 85 93 if hardrefresh: … … 94 102 Clear the figure. 95 103 """ 104 if not self.window: 105 asaplog.push( "No plotter window to terminate." ) 106 asaplog.post( "WARN" ) 107 return 96 108 self.window.close() 97 109 … … 100 112 Hide the ASAPlot graphics window. 101 113 """ 114 if not self.window: 115 asaplog.push( "No plotter window to unmap." ) 116 asaplog.post( "WARN" ) 117 return 102 118 self.window.hide() 103 119
Note: See TracChangeset
for help on using the changeset viewer.