Hi
I wanted to change the style of an object. so I tried to use lv_obj_get_style
and get its style and then make the changes I wanted.
but it didn’t work. After debugging, I found out that it’s because of that when I want to do this the object is focused and the style I get is not its style and the change I make is set on group_mod_style
.
Am I right?
I decided to use this lv_style_t * tmp_style = my_obj->style_p;
istead of lv_obj_get_style(my_obj);
what do you think? Is it a good idea or not?
There should be a callback related to group_mod
. I will check when I am at my PC.
1 Like
That’s correct. lv_obj_get_style()
returns the style which is really used by the object. For example if a label has style == NULL
it will give the parent’s style. And similarly it will give the focused style which is just a temporal variable. I’ll update the docs to emphasize this.
1 Like