# lv_list.h (/api/public/widgets/lv_list_h)



<ApiSummary functions="8" macros="1" variables="3" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (2)&#x22;,&#x22;Getters (1)&#x22;,&#x22;Other (5)&#x22;]">
  <ApiTab value="Setters (2)">
    <ApiMember kind="function" name="lv_list_set_button_text" file="public/widgets/lv_list.h" line="97" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L97">
      lv_list_set_button_text [#lv_list_set_button_text]

      Set text of a given list button

      \> &#x2A;*Deprecated:** The `lv_list` widget is deprecated. See `lv_example_flex_list`.

      ```c title=" " lineNumbers=1
      void lv_list_set_button_text(lv_obj_t *list, lv_obj_t *btn, const char *txt)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description           |
      | ------ | ------------------------------------------------ | --------------------- |
      | `list` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a list     |
      | `btn`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to the button |
      | `txt`  | `const char *`                                   | pointer to the text   |
    </ApiMember>

    <ApiMember kind="function" name="lv_list_set_button_translation_tag" file="public/widgets/lv_list.h" line="131" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L131">
      lv_list_set_button_translation_tag [#lv_list_set_button_translation_tag]

      Set translation tag text of a given list button

      \> &#x2A;*Deprecated:** The `lv_list` widget is deprecated. See `lv_example_flex_list`.

      ```c title=" " lineNumbers=1
      void lv_list_set_button_translation_tag(lv_obj_t *list, lv_obj_t *btn, const char *tag)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                    |
      | ------ | ------------------------------------------------ | ------------------------------ |
      | `list` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a list              |
      | `btn`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to the button          |
      | `tag`  | `const char *`                                   | pointer to the translation tag |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (1)">
    <ApiMember kind="function" name="lv_list_get_button_text" file="public/widgets/lv_list.h" line="87" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L87">
      lv_list_get_button_text [#lv_list_get_button_text]

      Get text of a given list button

      \> &#x2A;*Deprecated:** The `lv_list` widget is deprecated. See `lv_example_flex_list`.

      ```c title=" " lineNumbers=1
      const char * lv_list_get_button_text(lv_obj_t *list, lv_obj_t *btn)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description           |
      | ------ | ------------------------------------------------ | --------------------- |
      | `list` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a list     |
      | `btn`  | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to the button |

      **Returns:** `const char *` — text of btn, if btn doesn't have text "" will be returned
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (5)">
    <ApiMember kind="function" name="lv_list_create" file="public/widgets/lv_list.h" line="56" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L56">
      lv_list_create [#lv_list_create]

      Create a list object

      \> &#x2A;*Deprecated:** Use a flex container with `LV_FLEX_FLOW_COLUMN` instead. See `lv_example_flex_list`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_list_create(lv_obj_t *parent)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name     | Type                                             | Description                                                                                                         |
      | -------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
      | `parent` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a parent widget **May** be `NULL`.. When NULL, the widget is created as a screen on the default display. |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created list
    </ApiMember>

    <ApiMember kind="function" name="lv_list_add_text" file="public/widgets/lv_list.h" line="66" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L66">
      lv_list_add_text [#lv_list_add_text]

      Add text to a list

      \> &#x2A;*Deprecated:** Add a full-width `lv_label` to a flex container instead. See `lv_example_flex_list`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_list_add_text(lv_obj_t *list, const char *txt)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                                                                  |
      | ------ | ------------------------------------------------ | ---------------------------------------------------------------------------- |
      | `list` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a list, it will be the parent of the new label                    |
      | `txt`  | `const char *`                                   | text of the new label. **May** be `NULL`. When NULL the label is left empty. |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created label
    </ApiMember>

    <ApiMember kind="function" name="lv_list_add_button" file="public/widgets/lv_list.h" line="77" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L77">
      lv_list_add_button [#lv_list_add_button]

      Add button to a list

      \> &#x2A;*Deprecated:** Add a full-width `lv_button` to a flex container instead. See `lv_example_flex_list`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_list_add_button(lv_obj_t *list, const void *icon, const char *txt)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                                                                 |
      | ------ | ------------------------------------------------ | --------------------------------------------------------------------------- |
      | `list` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a list, it will be the parent of the new button                  |
      | `icon` | `const void *`                                   | icon for the button. **May** be `NULL`. When NULL it will have no icon.     |
      | `txt`  | `const char *`                                   | text of the new button. **May** be `NULL`. When NULL no text will be added. |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created button
    </ApiMember>

    <ApiMember kind="function" name="lv_list_add_translation_tag" file="public/widgets/lv_list.h" line="109" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L109">
      lv_list_add_translation_tag [#lv_list_add_translation_tag]

      Add translation tag text to a list

      \> &#x2A;*Deprecated:** The `lv_list` widget is deprecated. See `lv_example_flex_list`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_list_add_translation_tag(lv_obj_t *list, const char *tag)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                                               |
      | ------ | ------------------------------------------------ | --------------------------------------------------------- |
      | `list` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a list, it will be the parent of the new label |
      | `tag`  | `const char *`                                   | translation tag of the new label                          |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created label
    </ApiMember>

    <ApiMember kind="function" name="lv_list_add_button_translation_tag" file="public/widgets/lv_list.h" line="121" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L121">
      lv_list_add_button_translation_tag [#lv_list_add_button_translation_tag]

      Add translation tag button to a list

      \> &#x2A;*Deprecated:** The `lv_list` widget is deprecated. See `lv_example_flex_list`.

      ```c title=" " lineNumbers=1
      lv_obj_t * lv_list_add_button_translation_tag(lv_obj_t *list, const void *icon, const char *tag)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name   | Type                                             | Description                                                                                       |
      | ------ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------- |
      | `list` | <ApiLink name="lv_obj_t" display="lv_obj_t *" /> | pointer to a list, it will be the parent of the new button                                        |
      | `icon` | `const void *`                                   | icon for the button. **May** be `NULL`. When NULL it will have no icon.                           |
      | `tag`  | `const char *`                                   | translation tag of the new button. **May** be `NULL`. When NULL no translation tag will be added. |

      **Returns:** <ApiLink name="lv_obj_t" display="lv_obj_t *" /> — pointer to the created button
    </ApiMember>
  </ApiTab>
</ApiTabs>

Macros [#macros]

<ApiMember kind="macro" name="LV_LIST_DEPRECATED_MSG" file="public/widgets/lv_list.h" line="30" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L30">
  LV_LIST_DEPRECATED_MSG [#lv_list_deprecated_msg]

  ```c title=" " lineNumbers=1
  #define LV_LIST_DEPRECATED_MSG "lv_list is deprecated; build a list from a flex column instead. See the lv_example_flex_list example."
  ```

  \> &#x2A;*Deprecated:** The `lv_list` widget is deprecated and kept only for backward compatibility. A list is just a flex container with a column flow, so build one directly from `lv_obj` + a `LV_FLEX_FLOW_COLUMN` layout instead. See the `lv_example_flex_list` example for a starting point.
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="lv_list_class" file="public/widgets/lv_list.h" line="41" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L41">
  lv_list_class [#lv_list_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_list_class
  ```
</ApiMember>

<ApiMember kind="variable" name="lv_list_text_class" file="public/widgets/lv_list.h" line="42" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L42">
  lv_list_text_class [#lv_list_text_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_list_text_class
  ```
</ApiMember>

<ApiMember kind="variable" name="lv_list_button_class" file="public/widgets/lv_list.h" line="43" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/include/lvgl/widgets/lv_list.h#L43">
  lv_list_button_class [#lv_list_button_class]

  ```c title=" " lineNumbers=1
  const lv_obj_class_t lv_list_button_class
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_obj.h&#x22;]" includedBy="[&#x22;lvgl.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;]" />
