Export UI minor bug with slider event

What do you want to achieve?

Labels next to a slider to display it’s value. Works in SLS but can’t compile in exported UI code.

What have you tried so far?

I create a slider and label then create an event for the slider to “SET TEXT VALUE FROM SLIDER”. This works in SLS and in play mode it works fine.

Here is the exported code from ui.c

void ui_event_SliderDelay(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_VALUE_CHANGED) {
        _ui_slider_set_text_value(ui_LabelSliderDelay, target_obj, "delay ", " mS");
    }
}

It won’t compile because the _ui_slider_set_text_value function is passing target_obj but target is defined (not target_obj). I get this error:

     lv_obj_t * target = lv_event_get_target(e);
                ^
src\ui\ui.c: In function 'ui_event_SliderDelay':
src\ui\ui.c:334:56: error: 'target_obj' undeclared (first use in this function)
         _ui_slider_set_text_value(ui_LabelSliderDelay, target_obj, "delay ", " mS");

If I change it to target, then all is well and it compiles and works fine.

I have not checked if this happens with other types of events / objects.

Screenshot or video

Others

  • SquareLine Studio version: 1.1.0 beta1
  • Operating system: windows 10
  • Target hardware: arduino

Thanks for the report. It’s already fixed internally and fix will be available in v1.1.