lvgl.choice

Display a button showing an option value. When tapped a popup menu is opened with multiple options to choose from. Uses EdgeTX styling.

Syntax

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

parent:choice({settings})

Parameters

See the API page for parameter description and common settings.

Choice specific settings:

NameTypeDescriptionDefault if not set

title

String

Text to be displayed in the header of the popup menu.

Empty string

values

Table

Must contain a simple table of strings. Each string defines an options shown in the popup menu.

Empty list

get

Function

Called to get the index of the currently selected option, when the popup menu is first opened. Must return a number between 0 and the number of values - 1.

nil

set

Function

Called when the user taps on a menu item. The function is passed a single parameter wihich is the index of the selected item (0 .. number of values - 1)

nil

Return values

LVGL object

Notes

The popup menu is closed when the user selects an item, and the 'set' function is called.

If the user taps outside the menu or the RTN key is pressed, the popup menu is closed and the 'set' function is not called.

API Status

AvailStatusComment

BW radios

Color radios

active

Only available for One-Time script

Change log

EdgeTX versionChange

2.11.0

Introduced