Creating Graphical User Interfaces    

Waiting for User Input

The GUIDE application option,

Function does not return until application window dismissed

generates an application M-file that is designed to wait for user input. It does this by calling uiwait, which blocks further execution of the M-file.

While execution waits, MATLAB processes the event queue. This means that any user-interactions with the GUI (such as clicking a push button) can invoke callback routines, but the execution stream always returns to the application M-file until one of two events occurs:

This feature provides a way to block the MATLAB command line until the user responds to the dialog box, but at the same time, allows callback routines to execute. When used in conjunction with a modal dialog, you can restrict user interaction to the dialog.

Code in the Application M-File

GUIDE implements this feature by generating code in the application M-file that uses the uiwait command

where fig is the handle of the GUI figure.


 Using the System Background Colors Renaming Application Files and Tags