Specifications

5 Application Examples
5-10
Handle the case where the user closes the dialog from the window manager
close box without responding.
The following sections discuss the implementation of this dialog.
View the Layout and Application M-File
Use the following links to display the GUIDE Layout Editor and the MATLAB
Editor with a completed version of this example. This enables you to see the
values of all component properties and to understand how the components are
assembled to create the GUI. You can also see a complete listing of the code
that is discussed in the following sections.
Note The following links execute MATLAB commands and are designed to
work within the MATLAB Help browser. The first link adds a directory to your
MATLAB path.
Click here to display this GUI in the Layout Editor.
Click here to display the application M-file the editor.
Implementing the GUI
This section describes how to implement the GUI described in the previous
section.
Launching the Dialog
The Close button’s callback launches a dialog that asks for confirmation of the
impending close operation. The
Close button’s callback then waits for the
dialog to return a value that indicates the user’s response. To implement this
behavior, the dialog’s application M-file defines an output argument that the
Close button’s callback waits for.
Wait for User Input
To make the dialog wait for user input, select Function does not return until
application window dismissed
in the GUIDE Application Options dialog.
This option adds a call to
uiwait in the dialog’s application M-file.