iptaddcallback
Add function handle to callback list
Description
Examples
Add Two Callback Functions to Figure
Create a figure and register two callback functions. Whenever
MATLAB® detects mouse motion over the figure, function handles
f1
and f2
are called
in the order in which they were added to the list.
figobj = figure; f1 = @(varargin) disp('Callback 1'); f2 = @(varargin) disp('Callback 2'); iptaddcallback(figobj,'WindowButtonMotionFcn',f1); iptaddcallback(figobj,'WindowButtonMotionFcn',f2);
Input Arguments
Output Arguments
Tips
Callback functions that have already been added to an object using the
set
command continue to work after you calliptaddcallback
. The first time you calliptaddcallback
for a given object and callback, the function checks to see if a different callback function is already installed. If a callback is already installed, theniptaddcallback
replaces that callback function with theiptaddcallback
callback processor, and then adds the preexisting callback function to theiptaddcallback
list.
Version History
Introduced before R2006a