Issue with lv_obj_del

Which makes me think it would be better to add lv_obj_valid (and possibly lv_obj_check_type), both of which would return bool and could be used in a project-specific assertion.

That I think is best.

Quick question for you, how do you find an objects subtype at runtime (I havent dug into this yet).

For exp:
lv_obj_t *someType

How do I find at runtime if it is an lv_obj_t or lv_button or whatever?

I suppose I could do dynamic casting or rtti, but that seems like a sledgehammer

Now I just feel stupid, I should have RTFM’d

Thanks thought!

Great idea. Do you think the “debug mode” (to perform checks on every function call) is still viable?

@kisvegabor Debug mode on every function call may still be viable. Either way it will lead to a documentation “bug”

We will need to call out the functionality, maybe in a debugging section. I believe adding these options will make lvgl a lot easier to use for less experienced people

Seeing if we are in Debug or not is platform dependent. IMO is should be enabled by default in the simulator (also add log entry to tell “we are in debug mode which is safe but slow”) but disabled in lv_conf_templ.h.

That sounds good to me, or it could be tied to -DDEBUG, but that gets you into compiler semantics of which define that correctly, etc.

Great! I can put together the basic engine next week.


One day we should have a chat about some ideas I have and possible plans for 7.0…

I think lvgl is amazing (Hence why I am giving my time to it, sigh not enough of that), and I think with a few additions it could really be the best out there.

Good to hear that! Please open a topic in the “Feature request” topic and list your ideas. :slight_smile:

Issues with styles like this are very common. To mitigate this, I’ll add a “style check” too.

I’ve started to implement this in feat-debug branch.

Here is the API.
It used experimentally in lv_label.

Let me know what do you think.

I’ve added all the required asserts and merged this feature to dev-6.1 branch.
In lv_conf.h you can enable/disable which asserts to use.