Contenuto principale

iptPointerManager

Create pointer manager in figure

Description

iptPointerManager(hFigure) creates a pointer manager in the specified figure, hFigure. If the figure or graphics components in the figure also contains a pointer behavior structure, then the pointer manager controls the pointer behavior. A graphics container can be a graphics object or a UI component.

Use iptSetPointerBehavior to associate a pointer behavior structure with a particular graphics container and to define specific actions that occur when the mouse pointer moves over and then leaves the container.

example

iptPointerManager(hFigure,"disable") disables the figure's pointer manager.

iptPointerManager(hFigure,"enable") enables and updates the figure's pointer manager.

Examples

collapse all

Plot a line, then create a pointer manager in the parent figure of the line. Then, associate a pointer behavior structure with the line object in the figure that changes the mouse pointer into a fleur whenever the pointer is over it.

h = plot(1:10);
iptPointerManager(gcf);

Define a pointer behavior for the line object. When the pointer moves over the line object, change the mouse pointer into a fleur.

enterFcn = @(hFigure,currentPoint)set(hFigure,"Pointer","fleur");
iptSetPointerBehavior(h,enterFcn);

Input Arguments

collapse all

Figure associated with the pointer manager, specified as a Figure object.

More About

collapse all

Tips

  • If a figure already contains a pointer manager, then iptPointerManager(hFigure) does not create a new pointer manager. The syntax has the same behavior as iptPointerManager(hFigure,"enable").

  • iptPointerManager considers not just the object the pointer is over, but all objects in the figure. iptPointerManager searches the graphics objects hierarchy to find the first object that contains a pointer behavior structure. The iptPointerManager then executes that object's pointer behavior function. For more information, see Graphics Object Hierarchy.

    For example, you could set the pointer to be a fleur and associate that pointer with the axes. Then, when you slide the pointer into the figure window, it will initially be the default pointer, then change to a fleur when you cross into the axes, and remain a fleur when you slide over the objects parented to the axes.

  • If you specify a pointer behavior using iptSetPointerBehavior and then change the figure pointer without using iptSetPointerBehavior, then the iptPointerManager may not update to reflect the new behavior. Some ways to change the figure pointer without using iptSetPointerBehavior include using ROI objects such as Polygon, another graphics object, another custom UI, or code that modifies the pointer from within a callback.

Version History

Introduced in R2006a