tashuhka
tashuhka

Reputation: 5126

Avoid interruption of callback functions in Matlab GUI

I have a Matlab GUI that needs a high time to execute some callback functions. Besides, these functions include the following code:

 drawnow('expose');
 pause(handles.data.delay);

I want to avoid that those callback executions get interrupted in order to avoid data inconsistency if the user presses other buttons. Thus, I modify the figure settings as:

set(handles.figure, 'BusyAction','cancel', 'Interruptible','off');

However, the callbacks are still interrupted. How can I avoid it?

Note: I think that the problem is that I need to propagate the 'BusyAction' and 'Interruptible' values to all the controls in my GUI, is there any way to do it automatically? Like, for example, modifying the default value before generating the GUI.

Upvotes: 3

Views: 1189

Answers (1)

tashuhka
tashuhka

Reputation: 5126

The fastest and cleanest way to propagate any property to all UI objects is with findobj:

set(findobj('Type','uicontrol'), 'BusyAction','cancel', 'Interruptible','off');

Upvotes: 3

Related Questions