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.
See Also
Configuring Individual Segments
setLabel(_:forSegment:)label(forSegment:)image(forSegment:)setImageScaling(_:forSegment:)imageScaling(forSegment:)setWidth(_:forSegment:)width(forSegment:)setEnabled(_:forSegment:)isEnabled(forSegment:)setMenu(_:forSegment:)menu(forSegment:)setToolTip(_:forSegment:)toolTip(forSegment:)setTag(_:forSegment:)tag(forSegment:)