changeset 13847:9fc597693b0b

allow waitbar message to be a cellstr object * waitbar.m: Allow message to be cellstr.
author John W. Eaton <jwe@octave.org>
date Tue, 08 Nov 2011 19:59:37 -0500
parents 10a5c8155756
children 40e32fe44aaa
files scripts/plot/waitbar.m
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/waitbar.m	Tue Nov 08 14:50:15 2011 -0500
+++ b/scripts/plot/waitbar.m	Tue Nov 08 19:59:37 2011 -0500
@@ -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);