I’m working on a settings menu and the only input device I have is an encoder. The menu is created on a seperate screen and than switched in and out. I got sliders and buttons working and can select and actuate them using the encoder but labels are not selectable and therefore not clickable. Is this something I’m doing wrong or is this a limitation of the menu widget and labels??
Description
What MCU/Processor/Board and compiler are you using?
Nucleo F401RE running mbed OS 6
What do you want to achieve?
a settings menu using labels for navigation
What have you tried so far?
several examples with variing results
Code to reproduce
lv_obj_t * _menu = lv_menu_create(_menuScreen);
lv_menu_set_mode_root_back_btn(_menu, LV_MENU_ROOT_BACK_BTN_ENABLED);
v_obj_add_event_cb(_menu, btnEventHandler, LV_EVENT_CLICKED, _menu);
lv_obj_set_size(_menu, lv_disp_get_hor_res(NULL), lv_disp_get_ver_res(NULL));
lv_obj_center(_menu);
lv_obj_t * label;
lv_obj_t * cont;
lv_group_t * group = lv_group_create();
lv_group_set_default(group);
lv_indev_set_group(encoderDriver, group);
lv_obj_t * sub_1_page = lv_menu_page_create(_menu, "Page 1");
cont = lv_menu_cont_create(sub_1_page);
label = lv_label_create(cont);
lv_label_set_text(label, "Hello, I am hiding here");
lv_obj_t * sub_2_page = lv_menu_page_create(_menu, "Page 2");
cont = lv_menu_cont_create(sub_2_page);
label = lv_label_create(cont);
lv_label_set_text(label, "Hello, I am hiding here");
// Create a main page
lv_obj_t * _mainPage = lv_menu_page_create(_menu, NULL);
lv_obj_t * section;
section = lv_menu_section_create(_menu);
//create_slider(section, "Kd", 0, 150, 120);
//create_slider(section, "Ki", 0, 150, 50);
//create_slider(section, "Kp", 0, 150, 80);
cont = lv_menu_cont_create(section);
label = lv_label_create(cont);
lv_label_set_text(label, "Item 1");
v_menu_set_load_page_event(menu, cont, sub_1_page);
cont = lv_menu_cont_create(section);
label = lv_label_create(cont);
lv_label_set_text(label, "Item 2");
v_menu_set_load_page_event(menu, cont, sub_2_page);
lv_menu_set_page(_menu, _mainPage);