User`s guide
14 Manage Ca llback Executio n
% Enable the other push butto n
set(h_noninterrupt,'Enable','on')
end
The callback first disables the other push button and clears the axes in the
second GUI. It then calls the utility function
create_update_waitbar to
create and update a waitbar. When
create_update_waitbar returns, it
enables the other button.
Click a Plot Button
What happens whe n you click a Plot button depends on which Wait button
you clicked first and the
BusyAction property of the Plot button.
• If you click Surf Plot,whose
BusyAction property is queue,MATLAB
software queues the Surf Plot callback
surf_queue.
If you clicked the Wait (interruptible) button first,
surf_queue runs
and displays the surf plot when the waitbar issues a call to
drawnow,
terminates, or is destroyed.
If you clicked the Wait (noninterruptible) button first,
surf_queue runs
only when the waitbar terminates or is destroyed.
This is the
surf_queue callback:
function surf_q ueue (hObject,eventdata)
h_plot = surf(h_axes2,peaks_data) ;
end
• If you click Mesh Plot ,whoseBusyAction property is canc el,afterhaving
clicked Wait (noninterruptible), MATLAB software discards the button
click event and does not queue the
mesh_cancel callback.
If you click Mesh Plot after having clicked W ait (interruptible),the
Mesh Plot
BusyAction property has no effect. MATLAB software queues
the Mesh Plot callback,
mesh_cancel. It runs and displays the mesh plot
when the waitbar issues a call to
drawnow, terminates, or is destroyed.
This is the
mesh_plot callback:
function mesh_c ance l(hObject,eventdata)
14-10