Selecting an item from the list


I am using this to create a list, and I have a button that can navigate through the list.

How to select an item from the list?

For example, if “Save” got clicked, then …

I also read here, but it was not clear.

How to do this?


Hi @Armin ,

You would use a callback:

lv_obj_set_event_cb(list_btn, event_handler);
static void event_handler(lv_obj_t * obj, lv_event_t event)
    if(event == LV_EVENT_CLICKED) {
        if(lv_list_get_btn_text(obj) == "Save")
              some stuff here...
1 Like