Instance Method


Sets how the button highlights while pressed and how it shows its state.


func setButtonType(_ type: NSButton.ButtonType)



A constant specifying the type of button. This can be one of the constants defined in NSButton.ButtonType.


The setButtonType(_:) method redisplays the button before returning.

The types available are for the most common button types, which are also accessible in Interface Builder; you can configure different behavior with the highlightsBy and showsStateBy properties.

Note that there is no -buttonType method. The set method sets various button properties that together establish the behavior of the type.

See Also

Displaying the Cell

var highlightsBy: NSCell.StyleMask

A set of flags that indicate how the button highlights when it receives a mouse-down event (that is, when the button is pressed).

var showsStateBy: NSCell.StyleMask

The flags that indicate how the button cell shows its alternate state.