annotate scripts/plot/waitbar.m @ 13816:7ee18dc46bbb

new and improved non-integer figure handles * waitbar.m: Pass NaN and "integerhandle" property to __go_figure__. * __init_fltk__.cc (OpenGL_fltk::renumber, plot_window::renumber, figure_manager::renumber_figure, figure_manager::do_renumber_figure): New functions. (figure_manager::hnd2idx): Don't declare double arg as const. Include figure number in error message. (fltk_graphics_toolkit::update): Handle ID_INTEGERHANDLE. * graphics.h.in, graphics.cc (gh_manager::do_get_handle): Rename from gh_manager::get_handle. (gh_manager::get_handle): New static function. (gh_manager::renumber_figure): New static function. (gh_manager::do_renumber_figure): New function. (figure::properties::set_integerhandle): New function. (figure::properties::integerhandle): Tag property declaration with S. (F__go_figure__): Intercept and handle integerhandle property here. * graphics.h.in (children_property::renumber): New function. (base_properties::init_integerhandle): New virtual function. (figure::properties::init_integerhandle): New function. (base_properties::renumber_child, base_properties::renumber_parent): New functions.
author John W. Eaton <jwe@octave.org>
date Fri, 04 Nov 2011 06:25:13 -0400
parents 72875370e2d1
children b3e1f9ae64dc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 ## Copyright (C) 2011 John W. Eaton
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 ##
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 ## This file is part of Octave.
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 ##
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 ## your option) any later version.
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 ##
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 ## General Public License for more details.
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 ##
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 ## -*- texinfo -*-
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
20 ## @deftypefn {Function File} {} waitbar (@var{frac})
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
21 ## @deftypefn {Function File} {} waitbar (@var{frac}, @var{msg})
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
22 ## @deftypefnx {Function File} {} waitbar (@var{frac}, @var{h}, @dots{})
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
23 ## @deftypefnx {Function File} {} waitbar (@dots{}, "FigureProperty", "Value", @dots{})
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
24 ## @deftypefnx {Function File} {@var{h} = } waitbar (@dots{})
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
25 ## Create a waitbar filled to fraction @var{frac} and display an optional
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
26 ## message @var{msg}. The waitbar fraction must be in the range [0, 1]. If
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
27 ## the optional input @var{h} is specified then update the waitbar in the
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
28 ## specified figure handle. Otherwise, a new waitbar is created.
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
29 ##
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
30 ## The display of the waitbar window can be configured by passing
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
31 ## property/value pairs to the function.
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 ## @end deftypefn
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 ## Author: jwe
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
36 function retval = waitbar (varargin)
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
37
13806
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
38 persistent curr_waitbar;
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
39
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
40 if (nargin < 1)
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
41 print_usage ();
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
42 endif
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
44 frac = varargin{1};
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
45 varargin(1) = [];
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
47 if (! (isnumeric (frac) && isscalar (frac) && frac >= 0 && frac <= 1))
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
48 error ("waitbar: FRAC must be between 0 and 1");
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
49 endif
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
50
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
51 msg = false;
13806
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
52
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
53 if (isempty (varargin) && ! isempty (curr_waitbar))
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
54 h = curr_waitbar;
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
55 else
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
56 h = false;
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
57 endif
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
59 if (! isempty (varargin) && ishandle (varargin{1}))
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
60 h = varargin{1};
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 varargin(1) = [];
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
62 ## FIXME -- also check that H is really a waitbar?
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
63 if (! isfigure (h))
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
64 error ("waitbar: H must be a handle to a waitbar object");
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 endif
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
66 endif
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
68 if (! isempty (varargin))
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
69 msg = varargin{1};
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
70 varargin(1) = [];
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
71 if (! ischar (msg))
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
72 error ("waitbar: MSG must be a character string");
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 endif
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
74 endif
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
76 if (rem (numel (varargin), 2) != 0)
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
77 error ("waitbar: invalid number of property-value pairs");
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
78 endif
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
80 if (h)
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
81 p = findobj (h, "type", "patch");
13806
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
82 set (p, "xdata", [0; frac; frac; 0]);
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
83 ax = findobj (h, "type", "axes");
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
84 if (ischar (msg))
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
85 th = get (ax, "title");
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
86 curr_msg = get (th, "string");
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
87 if (! strcmp (msg, curr_msg))
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
88 set (th, "string", msg);
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
89 endif
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 endif
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
91 else
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13813
diff changeset
92 h = __go_figure__ (NaN, "position", [250, 500, 400, 100],
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
93 "numbertitle", "off",
13806
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
94 "toolbar", "none", "menubar", "none",
13816
7ee18dc46bbb new and improved non-integer figure handles
John W. Eaton <jwe@octave.org>
parents: 13813
diff changeset
95 "integerhandle", "off",
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
96 "handlevisibility", "callback",
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
97 varargin{:});
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
99 ax = axes ("parent", h, "xtick", [], "ytick", [],
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
100 "xlim", [0, 1], "ylim", [0, 1],
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
101 "xlimmode", "manual", "ylimmode", "manual",
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
102 "position", [0.1, 0.3, 0.8, 0.2]);
13806
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
103 patch (ax, [0; frac; frac; 0], [0; 0; 1; 1], [0, 0.35, 0.75]);
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
104
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
105 if (ischar (msg))
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
106 title (ax, msg);
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
107 endif
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
108 endif
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
110 drawnow ();
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
112 if (nargout > 0)
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
113 retval = h;
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114 endif
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115
13806
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
116 ## If there were no errors, update current waitbar.
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
117 curr_waitbar = h;
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
118
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 endfunction
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 %!demo
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
122 %! h = waitbar (0, "0.00%");
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
123 %! for i = 0:0.01:1
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
124 %! waitbar (i, h, sprintf ("%.2f%%", 100*i));
13803
a2e158c3451f provide the waitbar function
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 %! endfor
13806
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
126 %! close (h);
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
127
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
128 %!demo
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
129 %! h = waitbar (0, "please wait...");
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
130 %! for i = 0:0.01:1
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
131 %! waitbar (i, h);
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
132 %! endfor
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
133 %! close (h);
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
134
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
135 %!demo
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
136 %! h = waitbar (0, "please don't be impatient...");
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
137 %! for i = 0:0.01:1
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
138 %! waitbar (i);
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
139 %! endfor
a73c0811d2fa more updates for waitbar
John W. Eaton <jwe@octave.org>
parents: 13805
diff changeset
140 %! close (h);
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
141
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
142 %% Test input validation
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
143 %!error <FRAC must be between 0 and 1> waitbar (-0.5)
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
144 %!error <FRAC must be between 0 and 1> waitbar (1.5)
13813
72875370e2d1 allow waitbar test to succeed even if figure 1 exists
John W. Eaton <jwe@octave.org>
parents: 13806
diff changeset
145 %!error <MSG must be a character string> waitbar (0.5, struct ())
13805
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
146 %!error <invalid number of property-value pairs> waitbar (0.5, "msg", "Name")
b3cdef33ac0e waitbar.m: Update docstring. Only return output handle h if requested.
Rik <octave@nomad.inbox5.com>
parents: 13803
diff changeset
147