Revision: 8494
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8494&view=rev
Author:   efiring
Date:     2010-07-05 19:03:09 +0000 (Mon, 05 Jul 2010)

Log Message:
-----------
tkagg and fltkagg backends now have blocking show() like all the others

Modified Paths:
--------------
    trunk/matplotlib/CHANGELOG
    trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
    trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
    trunk/matplotlib/lib/matplotlib/rcsetup.py
    trunk/matplotlib/matplotlibrc.template

Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG  2010-07-05 01:26:53 UTC (rev 8493)
+++ trunk/matplotlib/CHANGELOG  2010-07-05 19:03:09 UTC (rev 8494)
@@ -1,3 +1,8 @@
+2010-07-05 TkAgg and FltkAgg backends are now consistent with other
+           interactive backends: when used in scripts from the
+           command line (not from ipython -pylab), show blocks,
+           and can be called more than once.
+
 2010-07-02 Modified CXX/WrapPython.h to fix "swab bug" on solaris so
            mpl can compile on Solaris with CXX6 in the trunk.  Closes
            tracker bug 3022815 - JDH

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2010-07-05 
01:26:53 UTC (rev 8493)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2010-07-05 
19:03:09 UTC (rev 8494)
@@ -97,15 +97,8 @@
     """
     for manager in Gcf.get_all_fig_managers():
         manager.show()
-    #mainloop, if an fltk program exist no need to call that
-    #threaded (and interractive) version
-    if show._needmain:
-        Fltk.Fl.run()
-        show._needmain = False
+    Fltk.Fl.run()
 
-show._needmain = True
-
-
 def new_figure_manager(num, *args, **kwargs):
     """
     Create a new figure manager instance

Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py   2010-07-05 
01:26:53 UTC (rev 8493)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py   2010-07-05 
19:03:09 UTC (rev 8494)
@@ -64,43 +64,15 @@
             figManager.show()
 
 
-def show(block=False):
+def show():
     """
     Show all figures.
 
-    Temporary, experimental kwarg *block* defaults to False to
-    provide the behavior present throughout mpl history to date:
-    interactive mode is forced on, and show does not block.
-
-    Set *block* to True to test the proposed new behavior,
-    consistent with other backends, in which show does not affect
-    interactive mode, and always blocks until all figures are closed.
-    In addition, the rcParam['tk.pythoninspect'] is ignored.
-
-    Use this kwarg only for testing; other backends do not accept
-    a kwarg to show, and might never do so.
     """
     for manager in Gcf.get_all_fig_managers():
         manager.show()
-    if block:
-        # proposed new behavior; seems to make this backend consistent
-        # with others, with no drawbacks identified yet.
-        Tk.mainloop()
-    else:
-        # long-time behavior: non-blocking, forces interactive mode
-        import matplotlib
-        matplotlib.interactive(True)
-        if rcParams['tk.pythoninspect']:
-            os.environ['PYTHONINSPECT'] = '1'
-        if show._needmain:
-            Tk.mainloop()
-            show._needmain = False
+    Tk.mainloop()
 
-show._needmain = True   # This can go away if we eliminate block=False option.
-
-
-
-
 def new_figure_manager(num, *args, **kwargs):
     """
     Create a new figure manager instance

Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py  2010-07-05 01:26:53 UTC (rev 
8493)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py  2010-07-05 19:03:09 UTC (rev 
8494)
@@ -297,6 +297,11 @@
         warnings.warn("Deprecated negative_linestyle specification; use 
'solid' or 'dashed'")
         return (0, dashes)  # (offset, (solid, blank))
 
+def validate_tkpythoninspect(s):
+    # Introduced 2010/07/05
+    warnings.warn("tk.pythoninspect is obsolete, and has no effect")
+    return validate_bool(s)
+
 validate_legend_loc = ValidateInStrings('legend_loc',[
   'best',
   'upper right',
@@ -526,7 +531,7 @@
 
     'cairo.format'       : ['png', validate_cairo_format],
     'tk.window_focus'    : [False, validate_bool],  # Maintain shell focus for 
TkAgg
-    'tk.pythoninspect'   : [False, validate_bool],  # Set PYTHONINSPECT
+    'tk.pythoninspect'   : [False, validate_tkpythoninspect],  # obsolete
     'ps.papersize'       : ['letter', validate_ps_papersize], # Set the 
papersize/type
     'ps.useafm'          : [False, validate_bool],  # Set PYTHONINSPECT
     'ps.usedistiller'    : [False, validate_ps_distiller], # use ghostscript 
or xpdf to distill ps output

Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template      2010-07-05 01:26:53 UTC (rev 
8493)
+++ trunk/matplotlib/matplotlibrc.template      2010-07-05 19:03:09 UTC (rev 
8494)
@@ -319,7 +319,6 @@
 
 # tk backend params
 #tk.window_focus   : False    # Maintain shell focus for TkAgg
-#tk.pythoninspect  : False    # tk sets PYTHONINSEPCT
 
 # ps backend params
 #ps.papersize      : letter   # auto, letter, legal, ledger, A0-A10, B0-B10


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to