Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSButtonMBS class.
NSButtonMBS.allowsMixedState as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSButtonMBS.alternateImage as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The image displayed by the button when it's in its alternate state, or nil if there is no alternate image. Note that some button types don't display an alternate image. Buttons don't display images by default.
(Read and Write property)
NSButtonMBS.alternateTitle as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSButtonMBS.attributedAlternateTitle as NSAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSButtonMBS.attributedTitle as NSAttributedStringMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSButtonMBS.backgroundColor as NSColorMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The background color is used only when drawing borderless buttons.
(Read and Write property)
NSButtonMBS.bezelColor as NSColorMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 16.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
Some examples using this property:
NSButtonMBS.bezelStyle as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Use this constants:
NSRoundedBezelStyle | = 1 |
NSRegularSquareBezelStyle | = 2 |
NSThickSquareBezelStyle | = 3 |
NSThickerSquareBezelStyle | = 4 |
NSDisclosureBezelStyle | = 5 |
NSShadowlessSquareBezelStyle | = 6 |
NSCircularBezelStyle | = 7 |
NSTexturedSquareBezelStyle | = 8 |
NSHelpButtonBezelStyle | = 9 |
NSSmallSquareBezelStyle | = 10 |
NSTexturedRoundedBezelStyle | = 11 |
NSRoundRectBezelStyle | = 12 |
NSRecessedBezelStyle | = 13 |
NSRoundedDisclosureBezelStyle | = 14 |
NSButtonMBS.hasDestructiveAction as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 22.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Available on macOS 11.0 and newer.
The default value of hasDestructiveAction is false. Setting this to true allows the system to guard a destructive-action button against accidental presses, and can give the button a special appearance in certain contexts to caution against unintentional use.
(Read and Write property)
NSButtonMBS.image as NSImageMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
A button's image is displayed when the button is in its normal state, or all the time for a button that doesn't change its contents when highlighting or displaying its alternate state.
(Read and Write property)
NSButtonMBS.imageDimsWhenDisabled as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
True to indicate that the button's image should dim when the button is disabled.
By default, all button types except NSSwitchButton and NSRadioButton do dim when disabled. When NSSwitchButtons and NSRadioButtons are disabled, only the associated text dims. The default setting for this condition is reasserted whenever you set ButtonType, so be sure to specify the button cell’s type before you set ImageDimsWhenDisabled.
(Read and Write property)
NSButtonMBS.imageHugsTitle as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 16.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Available in macOS 10.12 and newer.
(Read and Write property)
NSButtonMBS.imagePosition as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Value can be:
NSNoImage | 0 | The cell doesn’t display an image. |
NSImageOnly | 1 | The cell displays an image, but not a title. |
NSImageLeft | 2 | The image is to the left of the title. |
NSImageRight | 3 | The image is to the right of the title. |
NSImageBelow | 4 | The image is below the title. |
NSImageAbove | 5 | The image is above the title. |
NSImageOverlaps | 6 | The image overlaps the title. |
NSButtonMBS.imageScaling as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
These constants specify a cell’s image scaling behavior.
NSImageScaleProportionallyDown | 0 | If it is too large for the destination, scale the image down while preserving the aspect ratio. |
NSImageScaleAxesIndependently | 1 | Scale each dimension to exactly fit destination. This setting does not preserve the aspect ratio of the image. |
NSImageScaleNone | 2 | Do not scale the image. |
NSImageScaleProportionallyUpOrDown | 3 | Scale the image to its maximum possible dimensions while both staying within the destination area and preserving its aspect ratio. |
Available in OS X v10.5 and later.
(Read and Write property)
NSButtonMBS.isBordered as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSButtonMBS.isTransparent as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSButtonMBS.keyEquivalent as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSButtonMBS.keyEquivalentModifierMask as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Constants for the mask:
NSAlphaShiftKeyMask = 65536
Set if Caps Lock key is pressed.
Available in Mac OS X v10.0 and later.
NSShiftKeyMask = 131072
Set if Shift key is pressed.
Available in Mac OS X v10.0 and later.
NSControlKeyMask = 262144
Set if Control key is pressed.
Available in Mac OS X v10.0 and later.
NSAlternateKeyMask = 524288
Set if Option or Alternate key is pressed.
Available in Mac OS X v10.0 and later.
NSCommandKeyMask = 1048576
Set if Command key is pressed.
Available in Mac OS X v10.0 and later.
NSNumericPadKeyMask = 2097152
Set if any key in the numeric keypad is pressed. The numeric keypad is generally on the right side of the keyboard. This is also set if any of the arrow keys are pressed (NSUpArrowFunctionKey, NSDownArrowFunctionKey, NSLeftArrowFunctionKey, and NSRightArrowFunctionKey).
Available in Mac OS X v10.0 and later.
NSHelpKeyMask = 4194304
Set if the Help key is pressed.
Available in Mac OS X v10.0 and later.
NSFunctionKeyMask = 8388608
Set if any function key is pressed. The function keys include the F keys at the top of most keyboards (F1, F2, and so on) and the navigation keys in the center of most keyboards (Help, Forward Delete, Home, End, Page Up, Page Down, and the arrow keys).
Available in Mac OS X v10.0 and later.
NSDeviceIndependentModifierFlagsMask = 16777216
Used to retrieve only the device-independent modifier flags, allowing applications to mask off the device-dependent modifier flags, including event coalescing information.
Available in Mac OS X v10.4.
(Read and Write property)
NSButtonMBS.maxAcceleratorLevel as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 15.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Defaults to 2.
Available on Mac OS X 10.10.3.
(Read and Write property)
NSButtonMBS.showsBorderOnlyWhileMouseInside as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If isBordered returns false, the border is never displayed, regardless of what this method returns.
(Read and Write property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 14.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The sound that should be played when the user presses the button. The sound is played during a mouse-down event, such as NSLeftMouseDown.
Value is NSSoundMBS object.
(Read and Write property)
NSButtonMBS.SpringLoaded as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 15.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Defaults to false.
Available on Mac OS X 10.10.3.
(Read and Write property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
This can be NSOnState (1), NSOffState (0), NSMixedState (-1).
(Read and Write property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
The items on this page are in the following plugins: MBS MacControls Plugin.