# HG changeset patch # User jwe # Date 1174411104 0 # Node ID 73fcbac81f332323c18f47e00cdf6089362b80db # Parent 2efe282221ed58682aa73964d57b8972cf781b14 [project @ 2007-03-20 17:18:24 by jwe] diff -r 2efe282221ed -r 73fcbac81f33 scripts/ChangeLog --- a/scripts/ChangeLog Tue Mar 20 16:46:47 2007 +0000 +++ b/scripts/ChangeLog Tue Mar 20 17:18:24 2007 +0000 @@ -1,7 +1,15 @@ 2007-03-20 John W. Eaton + * plot/newplot.m: Call __request_drawnow__ after initializing axes. + * plot/text.m: Call __request_drawnow__ after creating text objects. + + * plot/clf.m: Don't call drawnow. + +2007-03-20 Daniel J Sebald . + * plot/drawnow.m: Make __go_close_all_registered__ persistent - instead of global. From Daniel J Sebald . + instead of global. Only register __go_close_all__ with atexit if + the plot stream is successfully opened. 2007-03-15 John W. Eaton diff -r 2efe282221ed -r 73fcbac81f33 scripts/plot/clf.m --- a/scripts/plot/clf.m Tue Mar 20 16:46:47 2007 +0000 +++ b/scripts/plot/clf.m Tue Mar 20 17:18:24 2007 +0000 @@ -32,7 +32,6 @@ for k = get (cf, "children") delete (k); endfor - drawnow (); else print_usage (); endif diff -r 2efe282221ed -r 73fcbac81f33 scripts/plot/drawnow.m --- a/scripts/plot/drawnow.m Tue Mar 20 16:46:47 2007 +0000 +++ b/scripts/plot/drawnow.m Tue Mar 20 17:18:24 2007 +0000 @@ -46,10 +46,6 @@ cmd = sprintf ("%s -title \"Figure %d\"", cmd, h); endif plot_stream = popen (cmd, "w"); - if (isempty (__go_close_all_registered__)) - atexit ("__go_close_all__"); - __go_close_all_registered__ = true; - endif if (plot_stream < 0) error ("drawnow: failed to open connection to gnuplot"); else @@ -57,6 +53,10 @@ if (isunix () && isempty (getenv ("DISPLAY"))) fprintf (plot_stream, "set terminal dumb\n;"); endif + if (isempty (__go_close_all_registered__)) + atexit ("__go_close_all__"); + __go_close_all_registered__ = true; + endif endif endif diff -r 2efe282221ed -r 73fcbac81f33 scripts/plot/newplot.m --- a/scripts/plot/newplot.m Tue Mar 20 16:46:47 2007 +0000 +++ b/scripts/plot/newplot.m Tue Mar 20 17:18:24 2007 +0000 @@ -44,6 +44,7 @@ case "replacechildren" case "replace" __go_axes_init__ (ca, "replace"); + __request_drawnow__ (); otherwise error ("newplot: unrecognized nextplot property for current axes"); endswitch diff -r 2efe282221ed -r 73fcbac81f33 scripts/plot/text.m --- a/scripts/plot/text.m Tue Mar 20 16:46:47 2007 +0000 +++ b/scripts/plot/text.m Tue Mar 20 17:18:24 2007 +0000 @@ -78,12 +78,14 @@ "position", pos(i,:), varargin{:}); endfor + __request_drawnow__ (); elseif (n == nx) for i = 1:nx tmp(i) = __go_text__ (ca, "string", label{i}, "position", pos(i,:), varargin{:}); endfor + __request_drawnow__ (); else error ("text: dimension mismatch for coordinates and label"); endif diff -r 2efe282221ed -r 73fcbac81f33 src/ChangeLog --- a/src/ChangeLog Tue Mar 20 16:46:47 2007 +0000 +++ b/src/ChangeLog Tue Mar 20 17:18:24 2007 +0000 @@ -1,3 +1,7 @@ +2007-03-20 John W. Eaton + + * sysdep.cc (Fpause): Call drawnow. + 2007-03-15 John W. Eaton * variables.cc (F__lock_global__): Delete. diff -r 2efe282221ed -r 73fcbac81f33 src/sysdep.cc --- a/src/sysdep.cc Tue Mar 20 16:46:47 2007 +0000 +++ b/src/sysdep.cc Tue Mar 20 17:18:24 2007 +0000 @@ -84,6 +84,7 @@ #include "oct-obj.h" #include "ov.h" #include "pager.h" +#include "parse.h" #include "sighandlers.h" #include "sysdep.h" #include "toplev.h" @@ -648,15 +649,20 @@ if (! error_state) { - if (xisnan (dval)) - warning ("pause: NaN is an invalid delay"); - else if (xisinf (dval)) + if (! xisnan (dval)) { - flush_octave_stdout (); - octave_kbhit (); + feval ("drawnow"); + + if (xisinf (dval)) + { + flush_octave_stdout (); + octave_kbhit (); + } + else + octave_sleep (dval); } else - octave_sleep (dval); + warning ("pause: NaN is an invalid delay"); } } else