Button
Native button, can also be used as checkbox and radio button.
| Module | require("yue.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
- tableoptions- stringtitle - 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
setcontrolsize(size) macOS
Set the control size of the button.
Parameters
- ControlSizesize
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