Changeset 2152 for trunk


Ignore:
Timestamp:
04/25/11 18:38:07 (14 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: No

Module(s): asaplotter, asapfitter, sdplot, sdfit, sdflag

Description: register asaplot instance to matplotlib when backend is Qt4Agg.

This enables background plotting --- leaving plotter opened after exitting
from a function you created the plot.
On TkAgg backend, this is not explicitly done, seems to be done automagically.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asaplotgui_qt4.py

    r2151 r2152  
    77from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg, \
    88        FigureManagerQTAgg
     9from matplotlib import _pylab_helpers
    910# Force use of the newfangled toolbar.
    1011import matplotlib
     
    3435        self.window = self.figmgr.window
    3536        self.window.setWindowTitle('ASAP Plotter - Qt4')
     37        # register this plot to matplotlib
     38        _pylab_helpers.Gcf.set_active(self.figmgr)
    3639
    3740        #############
     
    3942        #############
    4043        def dest_callback():
    41             self.is_dead = True
     44            try:
     45                self.is_dead = True
     46            except NameError:
     47                pass
    4248
    4349        qt.QtCore.QObject.connect(self.window, qt.QtCore.SIGNAL('destroyed()'),dest_callback)
Note: See TracChangeset for help on using the changeset viewer.