Skip to Main Content Skip to Search
Product Documentation

uiresume - Resume execution of blocked program

Syntax

uiresume(h)

Description

uiresume(h) resumes the MATLAB program execution that uiwait suspended.

Tips

The uiwait and uiresume functions block and resume MATLAB program execution. When creating a dialog, you should have a uicontrol component with a callback that calls uiresume or a callback that destroys the dialog box. These are the only methods that resume program execution after the uiwait function blocks execution.

When used in conjunction with a modal dialog, uiresume can resume the execution of the program that uiwait suspended while presenting a dialog box.

Examples

This example creates a GUI with a Continue push button. The example calls uiwait to block MATLAB execution until uiresume is called. This happens when the user clicks the Continue push button because the push button's Callback callback, which responds to the click, calls uiresume.

f = figure;
h = uicontrol('Position',[20 20 200 40],'String','Continue',...
              'Callback','uiresume(gcbf)');
disp('This will print immediately');
uiwait(gcf); 
disp('This will print after you click Continue');
close(f);

gcbf is the handle of the figure that contains the object whose callback is executing.

Use a Modal Dialog Box to Confirm an Operation (GUIDE) is a more complex example for a GUIDE GUI. See Icon Editor for an example for a programmatically created GUI.

See Also

dialog | figure | uicontrol | uimenu | uiwait | waitfor

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS