MATLAB Creating Graphical User Interfaces

(ff) #1

Note: Before you can call lbox2 in the Command Window, you must save the GUIDE files
in a folder on your MATLAB® path. To save the files, select File > Save As in GUIDE.


Examine the Layout and Callback Code


(^1) In GUIDE, click the Editor button to view the code.
2
Near the top of the Editor window, use the Go To button to navigate to the
functions discussed below.
lbox2_OpeningFcn
The callback function lbox2_OpeningFcn executes just before the list box appears in
the UI for the first time. The following statements determine whether the user specified a
path argument to the lbox2 function.
if nargin == 3,
initial_dir = pwd;
elseif nargin > 4
if strcmpi(varargin{1},'dir')
if exist(varargin{2},'dir')
initial_dir = varargin{2};
Interactive List Box App in GUIDE

Free download pdf