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
nilto 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
setLabel(_:forSegment:)label(forSegment:)setImage(_:forSegment:)image(forSegment:)setImageScaling(_:forSegment:)imageScaling(forSegment:)setWidth(_:forSegment:)width(forSegment:)setEnabled(_:forSegment:)isEnabled(forSegment:)menu(forSegment:)setToolTip(_:forSegment:)toolTip(forSegment:)setTag(_:forSegment:)tag(forSegment:)