Creating Graphical User Interfaces | ![]() ![]() |
This section of the application M-file launches the dialog if the number of input arguments is zero or one numeric value. This involves:
openfig
to load the FIG-file.Note that the function returns one output argument, answer
, which is passed to the Close button callback.
function answer = modaldlg(varargin)
error(nargchk(0,4,nargin)) % function takes 0, 1, or 4 arguments
if nargin == 0 | isnumeric(varargin{1})
fig = openfig(mfilename,'reuse');
set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));
handles = guihandles(fig);
guidata(fig, handles);
![]() | The Confirmation Dialog Application M-file | Specify the Location of the Dialog | ![]() |