Image Processing Toolbox User's Guide |
Add function handle to callback list
Syntax
Description
ID = iptaddcallback(h,callback,func_handle)
adds the function handle func_handle
to the list of functions to be called when the callback specified by callback
executes. callback
is a string specifying the name of a callback property of the Handle Graphics object specified by the handle h
.
iptaddcallback
returns a unique callback identifier, ID
, that can be used with iptremovecallback
to remove the function from the callback list.
iptaddcallback
can be useful when you need to notify more than one tool about the same callback event for a single object.
Note
Callback functions that have already been added to an object using the set
command continue to work after you call iptaddcallback
. The first time you call iptaddcallback
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, iptaddcallback
replaces that callback function with the iptaddcallback
callback processor, and then adds the preexisting callback function to the iptaddcallback
list.
Example
This example creates a figure and registers 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.
h = figure; f1 = @(varargin) disp('Callback 1'); f2 = @(varargin) disp('Callback 2'); iptaddcallback(h, 'WindowButtonMotionFcn', f1); iptaddcallback(h, 'WindowButtonMotionFcn', f2);
See Also
ippl | iptcheckconn |
© 1994-2005 The MathWorks, Inc.