Structure
NSTrackingArea.Options
The data type defined for the constants specified in the options
parameter of init(rect: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, mouseEnteredAndExited
, mouseMoved
, and cursorUpdate
) and one of the active constants (that is, activeWhenFirstResponder
, activeInKeyWindow
, activeInActiveApp
, and activeAlways
). In addition, you may specify any of the behavior constants (that is, assumeInside
, inVisibleRect
, and enabledDuringMouseDrag
).
Topics
Constants
static var assumeInside: NSTrackingArea.Options
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
.
static var inVisibleRect: NSTrackingArea.Options
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
.