optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
params
yes
table
Field
Type
Description
x
number
position relative to the top-left of the parent
y
number
position relative to the top-left of the parent
w
number
width
h
number
height
color
color or function
primary color for the object
pos
function
dynamic position callback returning x, y
size
function
dynamic size callback returning w, h
visible
function
dynamic visibility callback
floating
boolean
keep the object fixed inside a scrollable container, added in 2.11.6, defaults to false
title
string
text displayed in the popup menu's header, defaults to an empty string
values
table
simple table of option strings shown in the popup; can be changed via lvgl.set() since 2.11.6, defaults to an empty list
get
function
called on every refresh cycle to keep the displayed value in sync, to get the index of the currently selected option (1..number of values), defaults to nil
set
function
called when the user taps a menu item; passed the selected item's index (1..number of values), defaults to nil
active
function
sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
filter
function
called for each option when the popup opens, passed the option's index; return true to show it, false to hide it, defaults to nil
popupWidth
number
width of the popup window, defaults to 0 (use default width)
Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise. @notice The popup closes and set is called when the user selects an item. @notice If the user taps outside the popup or presses RTN, the popup closes without calling set.