Skip to content

lvgl.page

lvgl.page(params)

Create a page layout for a One-Time script using EdgeTX styling: a header with title/sub-title lines and a back button in the top-left corner. Should be created as the top-level LVGL object, with all other objects added as its children.

Parameters

NameReqTypeDescription
paramsyestable
FieldTypeDescription
titlestring or functiontitle text in the header; function support added in 2.11.4, defaults to an empty string
subtitlestring or functionsub-title text in the header; function support added in 2.11.4, defaults to an empty string
iconstringfull path to a 30x30 grey-scale mask image for the back button icon (white = transparent, black = opaque); defaults to the EdgeTX logo icon
backfunctioncalled when RTN is pressed, or when the back button is tapped -- the top-left header button if backButton is not set, otherwise a second button on the top-right, defaults to nil
menufunctioncalled when the top-left header button is tapped, but only if backButton is set to true -- in that case back moves to a second button on the top-right, defaults to nil
prevButtontableadds a prev navigation button; table has a press function and optional active function (added in 2.11.4), defaults to nil
nextButtontableadds a next navigation button; table has a press function and optional active function (added in 2.11.4), defaults to nil
flexFlowlvgl.FLOW_COLUMN or lvgl.FLOW_ROWenables flex layout for this page, not used by default
flexPadnumberpadding between rows/columns when flex layout is used, defaults to PAD_OUTLINE
scrollBarbooleanenables/disables scroll bars, defaults to true
scrollDirlvgl.SCROLL_xxallowed scroll directions when child objects extend past the page bounds (stand alone scripts only), defaults to lvgl.SCROLL_ALL
scrolledfunctioncalled when the page content is scrolled; passed x, y of the current scroll position, defaults to nil
scrollTofunctionoverrides the page scroll position; must return x, y to scroll to, defaults to nil
alignalignment type (LEFT, RIGHT, CENTER, VTOP, VBOTTOM, VCENTER) alignment used with flex layouts (added in 2.11.4), defaults to CENTER | VTOP
backButtonbooleanif true, adds a second header button on the top-right calling back, and repurposes the top-left button to call menu instead (added in 2.11.4), defaults to false
borderPadnumber or tableborder padding around the container edges; a single number applies to all sides, or a table {left=?, right=?, top=?, bottom=?} (added in 2.11.5), defaults to PAD_OUTLINE if flexFlow is set, otherwise 0

Returns

Name Type Description
- table LVGL object, or nil if not running as a One-Time script or fullscreen widget

Availability

  • Since: 2.11.0
  • Radio support: color-lcd

Notes

  • Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise. @notice The common object settings (x, y, w, h, color, etc.) are not used by lvgl.page -- only the settings listed above apply. @notice The page automatically adds scroll bars if child objects fall outside its boundaries. @notice scrollBar, scrollDir, scrolled, and scrollTo were added in 2.11.2. @notice The PAGE keys are not automatically mapped to prevButton/nextButton -- the script's run function must detect and handle them itself.

Source

radio/src/lua/api_colorlcd_lvgl.cpp