Sorry, I've sent a corrupted patch. This one should work.

Regards,
Eike.
Index: backend_qt.py
===================================================================
--- backend_qt.py	(revision 3876)
+++ backend_qt.py	(working copy)
@@ -46,11 +46,14 @@
         qApp = qt.QApplication( [" "] )
         qt.QObject.connect( qApp, qt.SIGNAL( "lastWindowClosed()" ),
                             qApp, qt.SLOT( "quit()" ) )
-    else:
+        #remember that matplotlib created the qApp - will be used by show()
+        _create_qApp.qAppCreatedHere = True
+    # else:
       # someone else aready created the qApp and
       # we let them handle the event-loop control.
-      show._needmain = False
 
+_create_qApp.qAppCreatedHere = False
+
 def show():
     """
     Show all the figures and enter the qt main loop
@@ -65,13 +68,11 @@
     if figManager != None:
         figManager.canvas.draw()
 
-    if ( show._needmain ):
+    if _create_qApp.qAppCreatedHere:
+      #only start event loop if matplotlib created the qApp
       qt.qApp.exec_loop()
-      show._needmain = False
 
-show._needmain = True
 
-
 def new_figure_manager( num, *args, **kwargs ):
     """
     Create a new figure manager instance
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to