comparison scripts/plot/uigetdir.m @ 11295:75ff3db6a687

Simplify code for uimenu.m. Fix error messages for ui file functions.
author Kai Habel <kai.habel@gmx.de>
date Thu, 25 Nov 2010 17:16:46 +0100
parents f44c47959256
children c776f063fefe
comparison
equal deleted inserted replaced
11294:e2a4f3478b7c 11295:75ff3db6a687
28 ## Author: Kai Habel 28 ## Author: Kai Habel
29 29
30 function [retdir] = uigetdir (init_path = pwd, name = "Choose directory?") 30 function [retdir] = uigetdir (init_path = pwd, name = "Choose directory?")
31 31
32 if (!ischar(init_path) || !ischar(name)) 32 if (!ischar(init_path) || !ischar(name))
33 error ("Expecting string arguments."); 33 error ("uigetdir: expecting string arguments.");
34 endif 34 endif
35 35
36 if (nargin > 2) 36 if (nargin > 2)
37 print_usage (); 37 print_usage ();
38 endif 38 endif
41 if (!isdir (init_path)) 41 if (!isdir (init_path))
42 init_path = fileparts (init_path); 42 init_path = fileparts (init_path);
43 endif 43 endif
44 retdir = __fltk_uigetfile__ ("", name, init_path, [240, 120], "dir"); 44 retdir = __fltk_uigetfile__ ("", name, init_path, [240, 120], "dir");
45 else 45 else
46 error ("uigetdir requires fltk backend."); 46 error ("uigetdir: fltk backend required.");
47 endif 47 endif
48 48
49 endfunction 49 endfunction
50 50
51 %!demo 51 %!demo