Check Box text appearing unexpectedly

What do you want to achieve?

I’m updating a project from LVGLv8 to LVGLv9.3.0, and found that LVGL v9.3.0 check boxes default to the text “Check box”, but this isn’t cleared out by SquareLine Studio 1.6.1

What have you tried so far?

I put six checkboxes on a screen in LVGLv8.3.11, then upgraded the project to LVGLv9.3.0.

Screenshot or video

Here’s how SquareLine previews the screen:

But on-device the default “Check box” title appears:

This LVGL code seems to imply that LVGLv9 assigns a default text value, maybe LVGLv8 didn’t? I suspect SquareLine needs to lv_checkbox_set_text(checkbox_obj, "") when the title is empty, but currently appears not to, leading to the default text showing. I’m not sure why SquareLine’s preview seems correct though. Currently the exported code does not call lv_checkbox_set_text() on those checkboxes at all.

void test_checkbox_should_have_default_text_when_created(void)
{
    const char * default_text = "Check box";

    active_screen = lv_screen_active();
    checkbox = lv_checkbox_create(active_screen);

    TEST_ASSERT_EQUAL_STRING(default_text, lv_checkbox_get_text(checkbox));
    TEST_ASSERT_NOT_NULL(lv_checkbox_get_text(checkbox));
}

Others

  • SquareLine Studio version: 1.6.1
  • Operating system: Windows 11
  • Target hardware: Custom ESP32-S3 board

Hi, Thank you very much for the report, we have added it to the bug list.