Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSButtonMBS class.

NSButtonMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 8.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Creates a new button with size 100/100 and position 0/0
Example
dim t as new NSButtonMBS

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
Creates an object based on the given NSButton handle.
Example
dim t as new NSButtonMBS(0, 0, 100, 100)
dim v as new NSButtonMBS(t.handle)

MsgBox str(v.Bounds.Width)+" x "+str(v.Bounds.Height)

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
Creates a new button with the given size and position.
Example
dim x as new NSButtonMBS(0, 0, 100, 100)

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
Creates a new button with default settings.

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

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Controls MBS MacControls Plugin 7.8 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Sets the view to its next state.

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.


The biggest plugin in space...