Buttons created with the CreateButton method are used for interacting with the app.
This is done by calling a callback function after clicking on the button. You can specify such a callback function with the SetOnTouch Method:
btn.SetOnTouch( btn_OnTouch );
function btn_OnTouch()
{
// your OnTouch code goes here
}
function btn_OnTouch()
{
// your OnTouch code goes here
}
Styling
You can allow the button to auto-size by leaving out the dimensions
or you can specify a width and height as decimal fractions.
Setting the width and height to -1 whilst using the
You can customize the visual look in many ways by either using one of the existing style options
Methods
The following methods are available on the Button object:
Batch(
properties )
Focus()
GetAbsHeight() → Number: integer
GetAbsWidth() → Number: integer
GetParent() → app object
GetText() → String
GetTextSize(
mode )
→ Number
GetType() → String: “Button”
Gone()
Hide()
IsEnabled() → Boolean
IsVisible() → Boolean
SetEllipsize(
mode )
SetEnabled(
enable )
SetFontFile(
file )
Show()