2021-04-12 18:19:04 +02:00
|
|
|
```eval_rst
|
|
|
|
.. include:: /header.rst
|
|
|
|
:github_url: |github_link_base|/widgets/list.md
|
|
|
|
```
|
|
|
|
# List (lv_list)
|
|
|
|
|
|
|
|
## Overview
|
2021-05-18 14:25:17 +02:00
|
|
|
The List is basically a rectangle with vertical layout to which Buttons and Texts can be added
|
2021-04-12 18:19:04 +02:00
|
|
|
|
|
|
|
## Parts and Styles
|
|
|
|
|
2021-05-18 14:25:17 +02:00
|
|
|
**Background**
|
|
|
|
- `LV_PART_MAIN` The main part of the list that uses all the typical background properties
|
|
|
|
- `LV_PART_SCROLLBAR` The scrollbar. See the [Base objects](/widgets/obj) documentation for details.
|
2021-04-12 18:19:04 +02:00
|
|
|
|
2021-05-18 14:25:17 +02:00
|
|
|
**Buttons and Texts**
|
|
|
|
See the [/widgets/core/btn](Button)'s and [/widgets/core/label](Label)'s documentation.
|
2021-04-12 18:19:04 +02:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2021-05-18 14:25:17 +02:00
|
|
|
### Buttons
|
|
|
|
`lv_list_add_btn(list, icon, text)` adds a full-width button with an icon - that can be an image or symbol - and a text.
|
2021-04-12 18:19:04 +02:00
|
|
|
|
2021-05-18 14:25:17 +02:00
|
|
|
The text starts to scroll horizontally if its too long.
|
2021-04-12 18:19:04 +02:00
|
|
|
|
2021-05-18 14:25:17 +02:00
|
|
|
### Texts
|
|
|
|
`lv_list_add_text(list, icon, text)` adds a text.
|
2021-04-12 18:19:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
## Events
|
2021-05-18 14:25:17 +02:00
|
|
|
No special events are sent by the List, but sent by the Button as usual.
|
2021-04-12 18:19:04 +02:00
|
|
|
|
|
|
|
Learn more about [Events](/overview/event).
|
|
|
|
|
|
|
|
## Keys
|
2021-05-18 14:25:17 +02:00
|
|
|
No *Keys* are processed by the object type.
|
2021-04-12 18:19:04 +02:00
|
|
|
|
|
|
|
Learn more about [Keys](/overview/indev).
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```eval_rst
|
|
|
|
|
|
|
|
.. include:: /lv_examples/src/lv_ex_widgets/lv_ex_list/index.rst
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
```eval_rst
|
|
|
|
|
|
|
|
.. doxygenfile:: lv_list.h
|
|
|
|
:project: lvgl
|
|
|
|
|
|
|
|
```
|