Mercurial > hg > octave-nkf
diff scripts/plot/waitbar.m @ 17203:efd8963f925f
waitbar.m: Fix 2nd window pop-up when using gnuplot (bug #35773).
* scripts/plot/waitbar.m: Fix 2nd window pop-up when using gnuplot
(bug #35773).
author | Rik <rik@octave.org> |
---|---|
date | Wed, 07 Aug 2013 18:47:38 -0700 |
parents | 13da13e1e17f |
children | 359366a4994f |
line wrap: on
line diff
--- a/scripts/plot/waitbar.m +++ b/scripts/plot/waitbar.m @@ -107,13 +107,16 @@ endif endif else - h = __go_figure__ (NaN, "position", [250, 500, 400, 100], - "numbertitle", "off", - "toolbar", "none", "menubar", "none", - "integerhandle", "off", - "handlevisibility", "callback", - "tag", "waitbar", - varargin{:}); + ## Save and restore current figure + cf = get (0, "currentfigure"); + + h = figure ("position", [250, 500, 400, 100], + "numbertitle", "off", + "toolbar", "none", "menubar", "none", + "integerhandle", "off", + "handlevisibility", "callback", + "tag", "waitbar", + varargin{:}); ax = axes ("parent", h, "xtick", [], "ytick", [], "xlim", [0, 1], "ylim", [0, 1], @@ -129,6 +132,10 @@ msg = "Please wait..."; endif title (ax, msg); + + if (! isempty (cf)) + set (0, "currentfigure", cf); + endif endif drawnow ();