MATLAB Creating Graphical User Interfaces

(Barry) #1

9 Examples of GUIDE UIs


Modal Dialog Box in GUIDE


In this section...
“About the Example” on page 9- 2
“Set Up the Close Confirmation Dialog Box” on page 9- 2
“Set Up a UI with a Close Button” on page 9- 3
“Run the Program” on page 9- 4
“How Close Confirmation Dialogs Work” on page 9- 5

About the Example


This example shows how to create a modal dialog box to work with a UI that has a Close
button. Clicking the Close button displays the modal dialog box, which asks Are you
sure you want to close?.

Set Up the Close Confirmation Dialog Box


1 On the Home tab, in the Environment section, click Preferences > GUIDE >
Show names in component palette.
2 In the Command window, type guide.
3 In the GUIDE Quick Start dialog box, select Modal Question Dialog. Then, click
OK.
Free download pdf