Imgbtn "No data"

Description

In this mini application and the icons are simply image buttons(lv_imgbtn).
When you press it once and you switch to another container by hidding the current and then you are returning back to the main container, the same image button is displaed as “No data”. If you’ll repeat the same thing again, the icon is displayed again and this goes on and on.
I’m using the master repo of lvgl.

Console message: Warn: Image draw: src is NULL (lv_draw_img.c #77 lv_draw_img())

To be honest, I’m not quite sure if this is a bug or a mistake.

What MCU/Processor/Board and compiler are you using?

STM32L432KC

Code to reproduce

lv_application.zip (71.8 KB)
This is a complete lv application to be imported on the simulator with the icons included.

Screenshot and/or video

Screenshot from 2020-08-09 13-39-15 Screenshot from 2020-08-09 13-38-49

I haven’t tested but it seems it happens because you used lv_imgbtn_set_checkable(img_btn, true);. So if you click the button it goes to LV_STATE_CHECKED. However, you haven’t specified the image sources in this states.

See the example here: https://docs.lvgl.io/latest/en/html/widgets/imgbtn.html#simple-image-button

@kisvegabor, I’ve missunderstood the use of lv_imgbtn_set_checkable.
Works fine now. Thank you for your time. :slight_smile:

1 Like