menu(for:)
Overridden by subclasses to return a context-sensitive pop-up menu for a given mouse-down event.
Declaration
func menu(for event: NSEvent) -> NSMenu?Parameters
- event:
An object representing a mouse-down event.
Mentioned in
Discussion
The view can use information in the mouse event, such as its location over a particular element of the view, to determine what kind of menu to return. For example, a text object might display a text-editing menu when the cursor lies over text and a menu for changing graphics attributes when the cursor lies over an embedded image.
The default implementation returns the view’s normal menu.