Toggle buttons are basically Buttons with an additional light bar indicating if it is activated or not. The user can toggle this state by pressing on it.
You can allow the toggle button to auto-size by leaving out the dimensions or you can specify a width and height as decimal fractions of the screen's width and height.
Use the SetOnTouch method of your button object to set the name of a function you want to be called when the button is touched.
You can get the state of the toggle button at any time using the GetChecked method. The button state is also passed into your OnTouch callback function as a parameter every time the button is touched.
Methods
The following methods are available on the Toggle object:
Batch(
properties )
Focus()
GetAbsHeight() → Number: integer
GetAbsWidth() → Number: integer
GetChecked() → Boolean
GetParent() → app object
GetText() → String
GetTextSize(
mode )
→ Number
GetType() → String: “Toggle”
Gone()
Hide()
IsEnabled() → Boolean
IsVisible() → Boolean
SetEnabled(
enable )
Show()