Description
Forgive my ignorance, started with LVGL few days back. I have created multilevel menu some thing like the following.
Modify Parameters
------------------> Restricted ---------> Enter Password
------------------> Unrestricted
When i go to enter password, i have created label, i would like to add event to the label. Thanks in advance.
What MCU/Processor/Board and compiler are you using?
Elecrow 7" display with esp32s3
What LVGL version are you using?
Eclipse IDE Version: 2023-12 (4.30.0)
LVGL version 8.3
What do you want to achieve?
I would like to add event to the label so that whenever i touch it, it calls back.
What have you tried so far?
label = lv_label_create(cont);
lv_label_set_text(label, "Enter Password");
lv_obj_add_event_cb(label, pass_event_cb, LV_EVENT_ALL, NULL);
static void pass_event_cb(lv_event_t * e){
lv_event_code_t code = lv_event_get_code(e);
if(code == LV_EVENT_CLICKED || code == LV_EVENT_FOCUSED) {
/Focus on the clicked text area/
lv_example_textarea();
}
}