
555Graphics and GUI
oldCallback=get(hControl,'Callback'); % store callback for later use
set(hControl,'Callback',[]); % temporarily disable callback
drawnow; pause(0.05);
set(hControl,...); % perform the update
drawnow; pause(0.05);
set(hControl,'Callback',oldCallback); % restore the stored callback
and similarly for listeners:
1618
hListener = addlistener(hAxes, 'XLim', 'PostSet', @callbackFunction);
try
% R2014a or older:
set(hListener,'Enable','off'); % temporarily disable listener
set(hAxes,'xlim',[minDate maxDate]); % perform the update
set(hListener,'Enable','on'); % restore the listener
catch
% R2014b or ...