uiwait

Pauses the execution of code until the given handle, handle, is deleted, and the timeout, waittime, is reached.

Syntax

uiwait(handle)

uiwait(handle, waittime)

Inputs

handle
Handle of the given figure
Type: scalar
waittime (optional)
Specifies the wait time (in seconds) that the code execution will be paused for before checking if the handle is deleted. The default value is 1 second and in this case, the handle is checked every second until the program execution is resumed.
Type: scalar

Examples

Continuous wait, which pauses the execution until the figure is deleted:
handle=figure('Name', 'Grid Identification','NumberTitle', 'off','position', [500 100 800 700]);
uiwait(handle);
Pauses the execution until the timeout or until the figure is deleted, whichever occurs first:
handle=figure('Name', 'Grid Identification','NumberTitle', 'off','position', [500 100 800 700]);
uiwait(handle, 0.4);