Contents

wantsToTrackMouse()

Returns a Boolean value that indicates whether the attachment handles mouse events occurring over its image.

Declaration

@MainActor func wantsToTrackMouse() -> Bool

Discussion

The default implementation of this method returns true. The NSView containing the cell should invoke this method before sending a trackMouse(with:in:of:untilMouseUp:) message.

For an attachment in an attributed string, if the attachment cell returns false, its attachment character should be selected rather than the cell being asked to track the mouse. This results in the attachment icon behaving as any regular glyph in text.

See Also

Responding to mouse events