Mercurial > hg > octave-nkf
diff scripts/plot/refresh.m @ 14226:d580d7179f85
Use isfigure() to simplify some plot functions.
* figure.m, refresh.m, uiresume.m, uiwait.m: Simplify code by using isfigure().
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 18 Jan 2012 21:17:14 -0800 |
parents | 72c96de7a403 |
children | eaab03308c0b |
line wrap: on
line diff
--- a/scripts/plot/refresh.m +++ b/scripts/plot/refresh.m @@ -19,24 +19,25 @@ ## -*- texinfo -*- ## @deftypefn {Function File} {} refresh () ## @deftypefnx {Function File} {} refresh (@var{h}) -## Refresh a figure, forcing it to be redrawn. Called without an -## argument the current figure is redrawn, otherwise the figure pointed +## Refresh a figure, forcing it to be redrawn. When called without an +## argument the current figure is redrawn. Otherwise, the figure pointed ## to by @var{h} is redrawn. ## @seealso{drawnow} ## @end deftypefn function refresh (h) - if (nargin == 1) - if (!ishandle (h) || !strcmp (get (h, "type"), "figure")) - error ("refresh: expecting argument to be a valid figure handle"); + if (nargin > 1) + print_usage (); + elseif (nargin == 1) + if (! isfigure (h)) + error ("refresh: H must be a valid figure handle"); endif - elseif (nargin > 1) - print_usage (); else h = gcf (); endif - set(h,"__modified__", "on"); + set (h, "__modified__", "on"); drawnow (); + endfunction