# HG changeset patch # User John W. Eaton # Date 1320800377 18000 # Node ID 9fc597693b0b23015cf2f4adda6b844a40d8450c # Parent 10a5c815575631f2596ccf9ddf624b2f0d611c0d allow waitbar message to be a cellstr object * waitbar.m: Allow message to be cellstr. diff --git a/scripts/plot/waitbar.m b/scripts/plot/waitbar.m --- a/scripts/plot/waitbar.m +++ b/scripts/plot/waitbar.m @@ -76,8 +76,8 @@ if (! isempty (varargin)) msg = varargin{1}; varargin(1) = []; - if (! ischar (msg)) - error ("waitbar: MSG must be a character string"); + if (! (ischar (msg) || iscellstr (msg))) + error ("waitbar: MSG must be a character string or cell array of strings"); endif endif @@ -89,10 +89,11 @@ p = findobj (h, "type", "patch"); set (p, "xdata", [0; frac; frac; 0]); ax = findobj (h, "type", "axes"); - if (ischar (msg)) + if (ischar (msg) || iscellstr (msg)) th = get (ax, "title"); curr_msg = get (th, "string"); - if (! strcmp (msg, curr_msg)) + cmp = strcmp (msg, curr_msg); + if (all (cmp(:))) set (th, "string", msg); endif endif @@ -112,7 +113,7 @@ patch (ax, [0; frac; frac; 0], [0; 0; 1; 1], [0, 0.35, 0.75]); - if (! ischar (msg)) + if (! (ischar (msg) || iscellstr (msg))) msg = "Please wait..."; endif title (ax, msg);