Specifications
Launching a Dialog to Confirm an Operation
5-9
Launching a Dialog to Confirm an Operation
This example illustrates how to display a dialog when users attempt to close a
GUI. The purpose of the dialog is to force the user to confirm that they really
want to proceed with the close operation.
The following picture illustrates the dialog positioned over the GUI
application, awaiting the user’s response.
Dialog Requirements
You want to protect users from unintentionally closing a GUI application by
displaying a confirmation dialog when they press the
Close button on the main
application window.
You want the dialog to:
•Be launched by the application’s
Close button.
•Ask the user to confirm the close operation (i.e., respond yes or no).
•Block MATLAB execution until the user responds.
•Be modal to maintain focus while there is a pending operation.