setImage(_:forSegment:)
Sets the image for the specified segment.
Declaration
func setImage(_ image: NSImage?, forSegment segment: Int)Parameters
- image:
The image to apply to the segment or
nilif you want to clear the existing image. Images are not scaled to fit inside a segment. If the image is larger than the available space, it is clipped. - segment:
The index of the segment whose image you want to set. This method raises an exception (Rangeexception) if the index is out of bounds.