Skip to content

lvgl.button

Syntax

lvgl.button[parent], {settings})

parent:button({settings})

Parameters

See the API page for parameter description and common settings.

Button specific settings:

NameTypeDescriptionDefault if not set
textString or FunctionText to be displayed in the button.Empty string
pressFunctionCalled when the user taps on the button, after the user releases ENTER key or stops touching the screen.

Note: the 'press' function may optionally return a integer value. If the return value if non-zero then the button will be displayed in the 'checked' state.
nil
longpressFunctionCalled when the user long taps on the button.

Note: the 'longpress' function may optionally return a integer value. If the return value if non-zero then the button will be displayed in the 'checked' state.
nil
activeFunctionSet the enabled / disabled state. Return value must be a boolean - true to enable the control, false to disable.nil
checkedBooleanSets the initial 'checked' state for the button. If true the button will display in the checked state. Can be updated with the set() function.false
colorColor or FunctionSets the background color for the button.EdgeTx button style color - PRIMARY2 theme color.
textColorColor or FunctionSets the text color for the button label.EdgeTx button style color - SECONDARY1 theme color.
cornerRadiusNumberSets the radius for the corners of the button.EdgeTx button style radius.
fontFont value or FunctionSets the font size.
E.G.:
- MIDSIZE
- DBLSIZE
STDSIZE

Return values

LVGL object

API Status

AvailStatusComment
BW radiosfalse
Color radiostrueactiveOnly available for One-Time scripts and widgets running in full screen mode.

Change log

EdgeTX versionChange
2.11.0Introduced