Mercurial > hg > octave-lyh
changeset 17211: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 | 9e613baf431e |
children | d87179b38bcf |
files | scripts/plot/waitbar.m |
diffstat | 1 files changed, 14 insertions(+), 7 deletions(-) [+] |
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 ();