comparison scripts/ui/helpdlg.m @ 16508:f19e24c97b20

move common warndlg, errordlg, helpdlg, and msgbox code to private function * message_dialog.m: New file. * scripts/ui/module.mk: Include it in the list of functions. * errordlg.m, helpdlg.m, warndlg.m, msgbox.m: Call message_dialog to do most of the work.
author John W. Eaton <jwe@octave.org>
date Fri, 12 Apr 2013 18:17:26 -0400
parents ff061068a66c
children 7f2395651a1c
comparison
equal deleted inserted replaced
16507:8cb12cf9ca32 16508:f19e24c97b20
34 34
35 if (nargin < 1 || nargin > 2) 35 if (nargin < 1 || nargin > 2)
36 print_usage (); 36 print_usage ();
37 endif 37 endif
38 38
39 if (! ischar (msg)) 39 retval = message_dialog ("helpdlg", msg, title);
40 if (iscell (msg))
41 msg = sprintf ("%s\n", msg{:});
42 msg(end) = "";
43 else
44 error ("helpdlg: MSG must be a string or cellstr array");
45 endif
46 endif
47
48 if (! ischar (title))
49 error ("helpdlg: TITLE must be a character string");
50 endif
51
52 h = javaMethod ("helpdlg", "org.octave.JDialogBox", msg, title);
53 40
54 endfunction 41 endfunction
55 42