MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

NSButtonMBS.Constructor
method, Cocoa Controls, MBS CocoaControls Plugin (NSButton), class NSButtonMBS,
Plugin version: 8.2, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Creates a new button with size 100/100 and position 0/0
Example:
dim t as new NSButtonMBS
Notes: On success the handle property is not zero.

See also:

NSButtonMBS.Constructor(Handle as Integer)
method, Cocoa Controls, MBS CocoaControls Plugin (NSButton), class NSButtonMBS,
Plugin version: 10.3, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: 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)
Notes: 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)
method, Cocoa Controls, MBS CocoaControls Plugin (NSButton), class NSButtonMBS,
Plugin version: 7.8, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Creates a new button with the given size and position.
Example:
dim x as new NSButtonMBS(0, 0, 100, 100)
Notes: On success the handle property is not zero.

See also:

NSButtonMBS.Constructor(Title as String, Image as NSImageMBS = nil, Type as Integer = 0)
method, Cocoa Controls, MBS CocoaControls Plugin (NSButton), class NSButtonMBS,
Plugin version: 16.5, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Creates a new button with default settings.
Notes:
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)
method, Cocoa Controls, MBS CocoaControls Plugin (NSButton), class NSButtonMBS,
Plugin version: 7.8, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Sets how the button highlights while pressed and how it shows its state.
Notes:
Use this constants:

NSMomentaryLightButton= 0
NSPushOnPushOffButton= 1
NSToggleButton= 2
NSSwitchButton= 3
NSRadioButton= 4
NSMomentaryChangeButton= 5
NSOnOffButton= 6
NSMomentaryPushInButton= 7
NSButtonMBS.setNextState
method, Cocoa Controls, MBS CocoaControls Plugin (NSButton), class NSButtonMBS,
Plugin version: 7.8, Mac: Yes, Win: No, Linux: No, Console & Web: Yes, Feedback.

Function: Sets the view to its next state.
Notes: 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 CocoaControls Plugin.




Links
MBS Realbasic Plugins