Caller doesn't get a chance to set user data before callbacks are done


When I call any of the create functions such as obj = lv_label_create(parent), the next thing I do is set the user_data. However, the theme apply callback have already been complete with the user_data as NULL;

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


What LVGL version are you using?


What do you want to achieve?

obj = lv_label_create(parent,&my_user_data), so the callbacks are complete with my user_data correctly loaded in the obj.user_data field. I am writing a C++ library for lvgl and the user_data field normally holds the address of the object that owns the C lvgl object pointer.

What have you tried so far?

I have looked at the code and have seen that user_data is NULL when theme callbacks are done.