Description
Hello. There is a button with a label, when clicked, an event is called. There is a loop in the event. I want to update the label of the button every iteration, but the label is only updated when the event ends
What MCU/Processor/Board and compiler are you using?
STM32F407
What LVGL version are you using?
8.0.2
What do you want to achieve?
Update the button label every iteration
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
static void event_bt_unpair(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
lv_obj_t * lb_obj = lv_obj_get_child(obj, 0);
if(code == LV_EVENT_LONG_PRESSED)
{
for (int i = 0; i < sensor_count(); i++)
{
lv_label_set_text_fmt(lb_obj, "%d", i);
lv_obj_t * child = lv_obj_get_child(cont_seat_unpair, i);
if(lv_obj_get_state(child) & LV_STATE_CHECKED)
{
/*code*/
}
}
}
}