| Creating Graphical User Interfaces | ![]() |
uiwait causes modaldlg to wait before returning execution to the Close button callback. During this time, the dialog's callbacks can execute in response to user action.
uiwait waits until the dialog figure is deleted or a uiresume executes. This can be caused when:
X in the close box on the window border. If this happens, uiwait returns. Since the handle stored in the variable fig no longer corresponds to a figure, modaldlg uses an ishandle test to return 'cancel' to the Close button callback. uiresume after setting handles.answer to 'yes'.uiresume after setting handles.answer to 'no'. uiwait(fig);
if ~ishandle(fig)
answer = 'cancel';
else
handles = guidata(fig);
answer = handles.answer;
delete(fig);
end
| Specify the Location of the Dialog | Executing a Callback | ![]() |