Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSButtonMBS class.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 8.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
On success the handle property is not zero.
See also:
NSButtonMBS.Constructor(Handle as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 10.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The handle is casted to a NSButton and the plugin retains this handle.
See also:
NSButtonMBS.Constructor(left as Double, top as Double, width as Double, height as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
On success the handle property is not zero.
See also:
NSButtonMBS.Constructor(Title as String, Image as NSImageMBS = nil, Type as Integer = 0)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 16.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
For macOS 10.12, we use the convenience functions from Apple.
For older systems, we use our own code.
Title is the title to use. Can be empty.
Image is the image to use. Can be nil.
Type is the type, e.g. NSMomentaryLightButton.
See also:
NSButtonMBS.setButtonType(buttonType as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Use this constants:
NSMomentaryLightButton | = 0 |
NSPushOnPushOffButton | = 1 |
NSToggleButton | = 2 |
NSSwitchButton | = 3 |
NSRadioButton | = 4 |
NSMomentaryChangeButton | = 5 |
NSOnOffButton | = 6 |
NSMomentaryPushInButton | = 7 |
Some examples using this method:
- /MacCocoa/Dynamic FileOpenDialog
- /MacCocoa/NSSavePanel
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Database with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV Simple Demo with DataSource
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListBoxTV TableView
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Flat Only/ListboxTV with ContainerControl Cells
- /MacControls/Listbox and TableView Demos/ListboxTV drop-in/Hierarchical & Flat/ListBoxTV OutlineView
- /MacControls/NSButton Control Array
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Cocoa Controls | MBS MacControls Plugin | 7.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If the button has three states, it cycles through them in this order: on, off, mixed, on, and so forth. If the button has two states, it toggles between them.
The items on this page are in the following plugins: MBS MacControls Plugin.