iptSetPointerBehavior() - Image Processing
iptSetPointerBehavior(h, pointerBehavior) stores
the specified pointer behavior structure in the specified Handle Graphics
object, h. If h is an array
of objects, iptSetPointerBehavior stores the same
structure in each object. When used with a figure's pointer manager (see iptPointerManager), a pointer behavior
structure controls what happens when the figure's mouse pointer moves
over and then exits an object in the figure. For details about this
structure, see Pointer Behavior Structure.iptSetPointerBehavior(h, ) clears the
pointer behavior from the Handle Graphics object or objects.iptSetPointerBehavior(h, enterFcn) creates
a pointer behavior structure, setting the enterFcn field
to the function handle specified, and setting the traverseFcn and exitFcn fields
to . See Pointer Behavior Structure for details about these fields.
This syntax is provided as a convenience because, for most common
uses, only the enterFcn is necessary. Pointer Behavior StructureA pointer behavior structure contains three fields: enterFcn, traverseFcn,
and exitFcn. You set the value of these fields
to function handles and use the iptSetPointerBehavior function
to associate this structure with an HG object in a figure. If the
figure has a pointer manager installed, the pointer manager calls
these functions when the following events occur. If you set a field
to, no action is taken.Function HandleWhen Called
enterFcnCalled when the mouse pointer moves over the object.
traverseFcnCalled once when the mouse pointer moves over the object, and
called again each time the mouse moves within the object.
exitFcnCalled when the mouse pointer leaves the object.
When the pointer manager calls the functions you create, it
passes two arguments: a handle to the figure and the current position
of the pointer.
iptSetPointerBehavior(h, pointerBehavior)iptSetPointerBehavior(h, )iptSetPointerBehavior(h, enterFcn)
hPatch = patch([.25 .75 .75 .25 .25],...
[.25 .25 .75 .75 .25], 'r');
enterFcn = @(figHandle, currentPoint)...
set(figHandle, 'Pointer', 'fleur');
Output / Return Value
Alternatives / See Also