Description
How to programmatically select roller position?
What MCU/Processor/Board and compiler are you using?
ESP32 littlevgl Ver2.0.1 for arduino IDE
What do you want to achieve?
when ESP32 boot up i use below roller code to load default value from EEprom display on roller .
lv_obj_t * roller1 = lv_roller_create(h, NULL);
lv_roller_set_options(roller1, " 0 \n 1 \n 2 \n 3 \n 4 \n 5 \n 6 \n 7 \n 8 \n 9 ", true);
lv_roller_set_selected(roller1,BTRolload1, false);
lv_roller_set_visible_row_count(roller1, 3);
lv_obj_set_event_cb(roller1, B1roller_event);
i have one cancel button when user press on the cancel button. I need the roller roll back to the original position use variable BTRolload1.
What have you tried so far?
static void Btn_Cancel(lv_obj_t * obj, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
lv_roller_set_selected(roller1,BTRolload1, false);// THIS CODE DON’T WORK
}
else if(event == LV_EVENT_VALUE_CHANGED) {
printf(“Toggled…\n”);
}
}
Thank You