In button click event,when SET TEXT VALUE FROM SLIDER,-generate wrong code

What do you want to achieve?

there is a button to increase a slider and change a label.
add an event “click”
add an action to INCREMENT SLIDER.------it works ok
add another action to SET TEXT VALUE FROM SLIDER, (the text is from a Label), ----fail. I found it generate the wrong code:
generate code:

void ui_event_ButtonTemperaturePlus(lv_event_t * e)
{
    lv_event_code_t event_code = lv_event_get_code(e);
    lv_obj_t * target = lv_event_get_target(e);
    if(event_code == LV_EVENT_CLICKED) {
        _ui_slider_increment(ui_SliderSetTemperature, 1, LV_ANIM_ON);
        **_ui_slider_set_text_value(ui_LabelSetTemperature, target, "", "");**
       );
    }
    if(event_code == LV_EVENT_LONG_PRESSED_REPEAT) {
        _ui_slider_increment(ui_SliderSetTemperature, 1, LV_ANIM_ON);
    }
}

the code should be:

void ui_event_ButtonTemperaturePlus(lv_event_t * e)
{
    lv_event_code_t event_code = lv_event_get_code(e);
    lv_obj_t * target = lv_event_get_target(e);
    if(event_code == LV_EVENT_CLICKED) {
        _ui_slider_increment(ui_SliderSetTemperature, 1, LV_ANIM_ON);
        //_ui_slider_set_text_value(ui_LabelSetTemperature, target, "", "");
        **_ui_slider_set_text_value(ui_LabelSetTemperature, ui_SliderSetTemperature, "", "");**
    }
    if(event_code == LV_EVENT_LONG_PRESSED_REPEAT) {
        _ui_slider_increment(ui_SliderSetTemperature, 1, LV_ANIM_ON);
    }
}

What have you tried so far?

Screenshot or video

Others

  • **SquareLine Studio version: trail version 1.1.1
  • **Operating system:*win11
  • **Target hardware:**ESP32 DEVKITC

I have exactly the same problem. Moving the slider manually updates the label. Updating the slider using an event from a button moves the slider, but the label isn’t updated. Would be grateful for any help.

We are working on it. Thank you for the report.