Button object

The Button widget creates a clickable control for user interaction

Event Description
Button:onClick() Event fired when the user left clicks on the Button
Button:onContext() Event fired when the user right click on the Button
Button:onCreate() Event fired when Button has just been created
Button:onDrop() Event fired when the Button received a drag and drop content
Button:onHide() Event fired when the Button is hidden
Button:onHover() Event fired when the user moves the mouse pointer over the Button
Button:onLeave() Event fired when the mouse cursor leaves the Button
Button:onMouseDown() Event fired when the user presses a mouse button over the Button
Button:onMouseUp() Event fired when the user releases a mouse button over the Button
Button:onShow() Event fired when the Button is shown
Property Description Access Type
Button.align Align the Button relative to its parent readwrite boolean
Button.allowdrop Controls whether the Button is a drag and drop target readwrite boolean
Button.cursor Get/set the image of the mouse cursor as it hovers over the Button readwrite string
Button.enabled Controls whether the Button responds to mouse and other events readwrite boolean
Button.font Get/set the Button font readwrite string
Button.fontsize Get/set the Button font size readwrite number
Button.fontstyle Get/set the Button font style readwrite table
Button.hastext Get/set the Button's text visibility readwrite boolean
Button.height Get/set the Button's height readwrite number
Button.parent Get the Button's parent widget readonly
Button.text Get/set the Button text content readwrite string
Button.textalign Get/set the Button text alignment readwrite string
Button.tooltip Get/set the Button tooltip text readwrite string
Button.visible Controls whether the Button appears on screen readwrite boolean
Button.width Get/set the Button's width readwrite number
Button.x Get/set the Button's horizontal position readwrite number
Button.y Get/set the Button's vertical position readwrite number
Methods Description Return value
Button:autosize() Autosizes the Button -
Button:center() Centers the Button on the parent widget -
Button:constructor() Button object constructor
Button:hide() Hides the Button -
Button:loadicon() Load the Button icon boolean
Button:show() Shows the Button -
Button:toback() Puts the widget to the back -
Button:tofront() Brings the widget in front -