How to create a list widget with single selectable item?

I’m trying to make it using List widget, but i’m stuck.

Setting buttons checkable lv_btn_set_checkable may be a way to go, but how to unselect other?

Iterating over buttons and setting them unselected with lv_btn_set_state does not work.

Focusing selected button in list does nothing.

Are you using a button matrix for this? If so, you can set it so only one button can be pressed at a time (what is known as radio buttons in a lot of UIs). Below is a basic example of that:

// Set up button matrix
const char * btnm_map[] = {"BTN0", "BTN1", "BTN2", ""};
lv_obj_t * btnm = lv_btnmatrix_create(parent, NULL);
lv_btnmatrix_set_map(btnm, btnm_map);
lv_obj_set_event_cb(btnm, btnm_cb);

// Set so only one button is checked/pressed at a time (radio button behavior)
lv_btnmatrix_set_one_check(btnm, true);

// Initialize which one is checked/pressed (if applicable)
lv_btnmatrix_set_btn_ctrl(btnm, active_index, LV_BTNMATRIX_CTRL_CHECK_STATE);


no, i was trying to use List widget, but may be button matrix is a better solution tho.

Why? It should work. Please send a code snippet to reproduce it.