Creating Graphical User Interfaces | ![]() ![]() |
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:
uiresume
command.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
% Wait for callbacks to run and window to be dismissed:
uiwait(fig);
where fig
is the handle of the GUI figure.
Note
Ensure that you have only one occurrence of uiwait in your application
M-file, including in commented lines.
|
![]() | Using the System Background Colors | Renaming Application Files and Tags | ![]() |