Image Processing Toolbox User's Guide Previous page   Next Page
iptaddcallback

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.

See Also

iptremovecallback


Previous page  ippl iptcheckconn Next page

© 1994-2005 The MathWorks, Inc.