Sets the menu for the specified segment.
- macOS 10.3+
The menu you want to add to the segment or
nilto clear the current menu.
The index of the segment whose menu you want to set. This method raises an exception (
range) if the index is out of bounds.
Adding a menu to a segment allows the segment to be used as a pop-up button. If the segment has a menu only, then the menu displays when the user clicks the segment. If the segment has both a menu and an action, then the action triggers when the user clicks the segment and the menu displays when the user clicks and holds the segment.