Mercurial > octave
changeset 26006:71cf412a41ab
msgbox.m: Allow a struct input as described in the documentation.
* msgbox.m: Test for possible struct input in third argument position and
handle appropriately.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 01 Nov 2018 12:21:24 -0700 |
parents | 68350e746ff2 |
children | 790595e6ebb9 |
files | scripts/gui/msgbox.m |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/gui/msgbox.m Thu Nov 01 11:59:55 2018 -0700 +++ b/scripts/gui/msgbox.m Thu Nov 01 12:21:24 2018 -0700 @@ -92,6 +92,10 @@ error ("msgbox: MSG must be a string or a cell array of strings"); elseif (! ischar (tit)) error ("msgbox: TITLE must be a string or a cell array of strings"); + elseif (isstruct (icon)) + varargin{end+1} = icon; + nargs += 1; + icon = "none"; elseif (! any (strcmp (icon, {"help", "warn", "error", "none", "custom"}))) error ("msgbox: unhandled value for ICON data"); elseif (strcmp (icon, "custom"))