Skip to content

lvgl.toggle

Syntax

lvgl.toggle([parent], {settings})

parent:toggle({settings})

Parameters

See the API page for parameter description and common settings.

Toggle specific settings:

NameTypeDescriptionDefault if not set
getFunctionCalled to get the curent state of the toggle switch.
Must return a boolean or a number value. 0 or false if the toggle switch is off, 1 or true if it should be on.
nil
setFunctionCalled when the user interacts with the toggle switch.
The function is passed a single number parameter - 0 if the toggle switch is off, 1 if it is on.
nil
activeFunctionSet the enabled / disabled state. Return value must be a boolean - true to enable the control, false to disable.nil

Return values

LVGL object

API Status

AvailStatusComment
BW radiosfalse
Color radiostrueactiveOnly available for One-Time scripts

Change log

EdgeTX versionChange
2.11.0Introduced