Button
Native button, can also be used as checkbox and radio button.
| Module | require("gui") |
| Type | Class |
| Inherits | View |
Class methods
create(title)
Create a normal button with title.
Parameters
Stringtitle
Return
Buttoncreate(options)
Create a button by reading options.
Parameters
ObjectoptionsStringtitle - Button's title.Button::Typetype - Button's type.
Return
ButtonMethods
makeDefault()
Mark this button as default button.
setTitle(title)
Set button title.
Parameters
Stringtitle
getTitle()
Return the button title.
Return
StringsetChecked(checked)
Set checked state of checkbox or radio.
Parameters
Booleanchecked
isChecked()
Return whether checkbox or radio is checked.
Return
BooleansetImage(image)
Set the image of button.
Parameters
Imageimage
getImage()
Return the image of button.
Return
ImagesetButtonStyle(style) macOS
Set the visual style of the button.
Parameters
Button::Stylestyle
setHasBorder(yes) macOS
Set whether the button has a border.
Parameters
Booleanyes
hasBorder() macOS
Return whether the button has a border.
Return
BooleanEvents
onClick(self)
Emitted when button is clicked.
Parameters
Buttonself