Contents

setMenu(_:forSegment:)

Sets the menu for the specified segment.

Declaration

func setMenu(_ menu: NSMenu?, forSegment segment: Int)

Parameters

  • menu:

    The menu you want to add to the segment or nil to clear the current menu. This menu is displayed when the user clicks and holds the mouse button while the mouse is over the segment.

  • segment:

    The index of the segment whose menu you want to set. This method raises an exception (Rangeexception) if the index is out of bounds.

Discussion

Adding a menu to a segment allows that segment to be used as a pop-up button.

See Also

Configuring Individual Segments