Mac OS X Reference Library Apple Developer
Search

Pointers

This chapter discusses the standard pointers available in Mac OS X and provides information on implementing your own pointers. The standard pointers are designed to provide feedback to users. To maintain a consistent user experience, it is important that you use them only for their intended purpose.

Each pointer has a hot spot—the portion of the pointer that must be positioned over a screen object before mouse clicks or finger taps have an effect on the object. The hot spot should be intuitive, such as the tip of an arrow pointer or the center point of a crosshair. Screen objects have a hot zone—the area that the pointer’s hot spot must be within in order for clicks to have an effect.

Standard Pointers

Table 12-1 shows the standard pointers and explains when to use each. The “API information” column gives the constants to implement them in Cocoa or Carbon.

Table 12-1  Standard pointers in Mac OS X

Pointer

Use

API information

image: ../art/cu_arrowcursor.gif

Menu bar, desktop, scroll bar, resize control, title bar, close button, zoom button, minimize button, other controls.

Carbon: kThemeArrowCursor

Cocoa:arrowCursor

image: ../art/cu_contextualmenu.gif

Indicates the user can open a contextual menu for an item. Shown when the user presses the Control key while the pointer is over an object with a contextual menu.

Carbon:kThemeContextualMenuArrowCursor

Cocoa: Not available

image: ../art/cu_alias.gif

Indicates the drag destination will have an alias for the original object (the original object will not be moved).

Carbon:kThemeAliasArrowCursor

Cocoa: Not available

image: ../art/cu_poof.gif

Indicates that the proxy object being dragged will go away, without deleting the original object, if the mouse button is released. Used only for proxy objects.

Carbon:kThemePoofCursor

Cocoa:disappearingItemCursor

image: ../art/cu_copy.gif

Indicates that the drag destination will have a copy of the original object (the original object will not be moved).

Carbon:kThemeCopyArrowCursor

Cocoa: Not available

image: ../art/cu_no_entry.gif

Indicates an invalid drag destination.

Carbon:kThemeNotAllowedCursor

Cocoa: Not available

image: ../art/cu_ibeamcursor.gif

Selecting and inserting text.

Carbon:kThemeIBeamCursor

Cocoa:IBeamCursor

image: ../art/cu_crosshair.jpg

Precise rectangular selection, especially useful for graphics objects.

Carbon:kThemeCrossCursor

Cocoa:crosshairCursor

image: ../art/cu_pointing_hand.gif

URL links.

Carbon:kThemePointingHandCursor

Cocoa:pointingHandCursor

image: ../art/cu_open_hand.gif

Indicates that an item can be manipulated within its containing view.

Carbon:kThemeOpenHandCursor

Cocoa:openHandCursor

image: ../art/cu_closedhand.gif

Pushing, sliding, or adjusting an object within a containing view.

Carbon:kThemeClosedHandCursor

Cocoa:closedHandCursor

image: ../art/cu_move_left.gif

Moving or resizing an object, usually a splitter, to the left. Use when the user can move the object only in the indicated direction.

Carbon:kThemeResizeLeftCursor

Cocoa:resizeLeftCursor

image: ../art/cu_move_right.gif

Moving or resizing an object, usually a splitter, to the right. Use when the user can move the object only in the indicated direction.

Carbon:kThemeResizeRightCursor

Cocoa:resizeRightCursor

image: ../art/cu_move_left_and_right.gif

Moving or resizing an object, usually a splitter, to the left or the right.

Carbon:kThemeResizeLeftRightCursor

Cocoa:resizeLeftRightCursor

image: ../art/cu_move_up.gif

Moving or resizing an object, usually a splitter, upward. Use when the user can move the object only in the indicated direction.

Carbon:kThemeResizeUpCursor

Cocoa:resizeUpCursor

image: ../art/cu_move_down.gif

Moving or resizing an object, usually a splitter, downward. Use when the user can move the object only in the indicated direction.

Carbon:kThemeResizeDownCursor

Cocoa:resizeDownCursor

image: ../art/cu_moveupanddown.gif

Moving or resizing an object, usually a pane splitter, either upward or downward.

Carbon:kThemeResizeUpDownCursor

Cocoa:resizeUpDownCursor

The spinning wait cursor (see Figure 12-1) is displayed automatically by the window server when an application cannot handle all of the events it receives. If an application does not respond for about 2 to 4 seconds, the spinning wait cursor appears. You should try to avoid situations in your application in which the spinning wait cursor will be displayed. The Spin Control application provided with Xcode can help you eliminate code that is causing this cursor.

Figure 12-1  Spinning wait cursor

Spinning wait cursor

Designing Your Own Pointers

Mac OS X supports 32-bit RGBA pointers in sizes up to 64 x 64 pixels. If you need a pointer larger than that, you can implement it as a window that tracks with the pointer.

Before you design your own pointer, ask yourself if it is going to add value to the user interface. Recognize that by doing so you are introducing a new, potentially confusing user interface element. If you decide you really need a new pointer, keep the following in mind:

If creating a custom pointer is necessary, both Cocoa and Carbon applications should use NSCursor methods to do so.




Last updated: 2009-08-20

Did this document help you? Yes It's good, but... Not helpful...