Specifications

4 Programming GUIs
4-40
Example: Using the Modal Dialog to Confirm an Operation
This example illustrates how to use the modal dialog GUI together with
another GUI that has a
Close button. Clicking the Close button displays the
modal dialog, which asks users to confirm that they really want to proceed with
the close operation.
The following figure illustrates the dialog positioned over the GUI application,
awaiting the user’s response.
The example is presented in the following sections:
“View Completed Layouts and Their GUI M-Files” on page 4-40
“Setting Up the Close Confirmation Dialog” on page 4-41
“Setting Up the GUI with the Close Button” on page 4-42
“Running the GUI with the Close Button” on page 4-43
“How the GUI and Dialog Work” on page 4-44
View Completed Layouts and Their GUI M-Files
If you are reading this in the MATLAB Help Browser, you can click 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.