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
A Boolean value indicating whether the button allows a mixed state.

(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 that appears on the button when it's in its alternate state.

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
The title that the button displays when it's in its alternate state.

(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
The title that appears on the button when it's in its alternate state to the given attributed string.

(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
The title that the button displays in its normal state as an attributed string.

(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.

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
The color of the button's bezel, in appearances that support it.

(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
The appearance of the border, if the view has one.

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
(Read and Write property)

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
A Boolean value that defines whether a button’s action has a destructive effect.

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
The view's image.

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
Whether the receiver’s image appears "dim" when the button cell is disabled.

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
Whether image hugs title.

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
The position of the button's image relative to its title.

Value can be:

NSNoImage0The cell doesn’t display an image.
NSImageOnly1The cell displays an image, but not a title.
NSImageLeft2The image is to the left of the title.
NSImageRight3The image is to the right of the title.
NSImageBelow4The image is below the title.
NSImageAbove5The image is above the title.
NSImageOverlaps6The image overlaps the title.
(Read and Write property)

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
The scale factor for the receiver’s image.

These constants specify a cell’s image scaling behavior.

NSImageScaleProportionallyDown0If it is too large for the destination, scale the image down while preserving the aspect ratio.
NSImageScaleAxesIndependently1Scale each dimension to exactly fit destination. This setting does not preserve the aspect ratio of the image.
NSImageScaleNone2Do not scale the image.
NSImageScaleProportionallyUpOrDown3Scale 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
A Boolean value indicating whether the button has a border.

(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
A Boolean value indicating whether the button is transparent.

(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
The key-equivalent character of the view.

(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
the controls's keyboard equivalent modifier mask.
Example
const NSShiftKeyMask=131.072
const NSControlKeyMask=262144
const NSAlternateKeyMask=524288
const NSCommandKeyMask=1048576

dim d as NSButtonMBS // your button
d.KeyEquivalent="A"
d.KeyEquivalentModifierMask=NSShiftKeyMask+NSCommandKeyMask+NSAlternateKeyMask // command-option-shift

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
Configures the maximum allowed level for an NSMultiLevelAcceleratorButton, allowed values range from [1,5].

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
Whether the view's border is displayed only when the cursor is over the button.

If isBordered returns false, the border is never displayed, regardless of what this method returns.
(Read and Write property)

NSButtonMBS.sound as Variant

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 played when the user presses the button.

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
Sends action on deep-press or extended hover while dragging.

Defaults to false.
Available on Mac OS X 10.10.3.
(Read and Write property)

NSButtonMBS.state 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
The state of the button.

This can be NSOnState (1), NSOffState (0), NSMixedState (-1).
(Read and Write property)

NSButtonMBS.title 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
The title displayed on the button when it's in its normal state.

(Read and Write property)

The items on this page are in the following plugins: MBS MacControls Plugin.


The biggest plugin in space...