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
String
title
Return
Button
create(options)
Create a button by reading options
.
Parameters
Object
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
setControlSize(size)Set the control size of the button.
Parameters
ControlSize
size
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