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
string
title
Return
Button
create(options)
Create a button by reading options
.
Parameters
table
optionsstring
title - Button's title.Button::Type
type - Button's type.
Return
Button
Methods
makedefault()
Mark this button as default button.
settitle(title)
Set button title.
Parameters
string
title
gettitle()
Return the button title.
Return
string
setchecked(checked)
Set checked
state of checkbox or radio.
Parameters
boolean
checked
ischecked()
Return whether checkbox or radio is checked.
Return
boolean
setimage(image)
Set the image of button.
Parameters
Image
image
getimage()
Return the image of button.
Return
Image
macOS
setbuttonstyle(style)Set the visual style of the button.
Parameters
Button::Style
style
macOS
sethasborder(yes)Set whether the button has a border.
Parameters
boolean
yes
macOS
hasborder()Return whether the button has a border.
Return
boolean
Events
onclick(self)
Emitted when button is clicked.
Parameters
Button
self