A Button is a Component that reacts on mouseclicks and other mouseactions.
Creating a simple button that reacts on mouseclicks is as easy as this:btn = Button:new(10,10,80,30,"Hello") -- create button function btn:onClicked() -- function that is called on click events print("Hello") -- do whatever you like end -- put the button now on the root container Container.getRootContainer():add(btn) -- otherwise it won't be visible
o-+ Component
o-+ Button
o-- Checkbox
creates a new Button object.
The Skin should have 8 states:
function actionfunction (buttonobject,datatable)
the datatable contains at index 1 the function and at index 2
the description. You can change the datatable in any way you want -
however, the function at index 1 will be the function that is being
called if an action occurs.
description from overloaded method of Component:
returns true if the component can be focused. If you overload this method, please remember that you should return false if your element is current not focusable, ie. if not visible or not enabled.
For example:function TextField.isFocusable() return true and self:isVisible() end
description from overloaded method of Component:
returns true if the component is displayed (is actually on the rootpane) and is visible.