Enumeration

NSTrackingAreaOptions

The data type defined for the constants specified in the options parameter of initWithRect:options:owner:userInfo:. These constants are described below; you can specify multiple constants by performing a bitwise-OR operation with them. In particular, you must supply one or more of the tracking-type constants (that is, NSTrackingMouseEnteredAndExited, NSTrackingMouseMoved, and NSTrackingCursorUpdate) and one of the active constants (that is, NSTrackingActiveWhenFirstResponder, NSTrackingActiveInKeyWindow, NSTrackingActiveInActiveApp, and NSTrackingActiveAlways). In addition, you may specify any of the behavior constants (that is, NSTrackingAssumeInside, NSTrackingInVisibleRect, and NSTrackingEnabledDuringMouseDrag).

Declaration

typedef enum NSTrackingAreaOptions : NSUInteger {
    ...
} NSTrackingAreaOptions;

Topics

Constants

NSTrackingMouseEnteredAndExited

The owner of the tracking area receives mouseEntered: when the mouse cursor enters the area and mouseExited: events when the mouse leaves the area. This value specifies a type of tracking area.

NSTrackingMouseMoved

The owner of the tracking area receives mouseMoved: messages while the mouse cursor is within the area. This value specifies a type of tracking area.

NSTrackingCursorUpdate

The owner of the tracking area receives cursorUpdate: messages when the mouse cursor enters the area; when the mouse leaves the area, the cursor is appropriately reset. This value specifies a type of tracking area.

NSTrackingActiveWhenFirstResponder

The owner receives messages when the view is the first responder. This value specifies when the tracking area defined by an NSTrackingArea object is active.

NSTrackingActiveInKeyWindow

The owner receives messages when the view is in the key window. This value specifies when the tracking area defined by an NSTrackingArea object is active.

NSTrackingActiveInActiveApp

The owner receives messages when the application is active. This value specifies when the tracking area defined by an NSTrackingArea object is active.

NSTrackingActiveAlways

The owner receives messages regardless of first-responder status, window status, or application status. The cursorUpdate: message is not sent when the NSTrackingCursorUpdate option is specified along with this constant. This value specifies when the tracking area defined by an NSTrackingArea object is active.

NSTrackingAssumeInside

The first event is generated when the cursor leaves the tracking area, regardless if the cursor is inside the area when the NSTrackingArea is added to a view. If this option is not specified, the first event is generated when the cursor leaves the tracking area if the cursor is initially inside the area, or when the cursor enters the area if the cursor is initially outside it. Generally, you do not want to request this behavior. This value specifies a behavior of the tracking area defined by the NSTrackingArea.

NSTrackingInVisibleRect

Mouse tracking occurs only in the visible rectangle of the view—in other words, that region of the tracking rectangle that is unobscured. Otherwise, the entire tracking area is active regardless of overlapping views. The NSTrackingArea object is automatically synchronized with changes in the view’s visible area (visibleRect) and the value returned from rect is ignored. This value specifies a behavior of the tracking area defined by the NSTrackingArea.

NSTrackingEnabledDuringMouseDrag

The owner receives NSMouseEntered events when the mouse cursor is dragged into the tracking area. If this option is not specified, the owner receives mouse-entered events when the mouse is moved (no buttons pressed) into the tracking area and on NSLeftMouseUp events after a mouse drag.