lvgl.box
Create a container for managing object layout.
Syntax
lvgl.box([parent], {settings})
parent:box({settings})
Parameters
See the API page for parameter description and common settings.
Box specific settings:
flexFlow
Flow type - lvgl.FLOW_COLUMN or lvgl.FLOW_ROW
Enable flex layout for this box.
not used
flexPad
Number
When flex layout is used, set the padding between rows or columns. Recommended to use the lvgl.PAD_xxx values.
0
scrollBar
Boolean
Enables or disables scroll bars. Set to false to disable scroll bars.
true
scrollDir
Scroll type - lvgl.SCROLL_xx
Sets the allowed scrolling directions if child objects extend beyond the box boundaries. Only valid for stand alone scripts.
lvgl.SCROLL_ALL
scrolled
Function
Called when the box content is scrolled. Passed two parameters 'x', and 'y' which are the current scroll position of the box window.
nil
scrollTo
Function
Function to override the box scroll position. Must return two values, 'x' and 'y' which are the position to scroll the box window to.
nil
Notes
The box object is a helper for managing screen layouts.
When adding controls such as button, toggle, textEdit etc, be sure to leave enough space for the focus outline around the control.
When used in a stand alone tool script, the box will automatically add scroll bars if any child objects are placed outside of the box boundaries. For widgets, child objects outside the box bounds will be clipped.
Return values
LVGL object
API Status
BW radios
Color radios
Return values
LVGL object
Change log
2.11.0
Introduced
Last updated
Was this helpful?