How does lvgl realize cross-interface communication?

Description

I want to realize that when the current interface data has changed, I can tell other related interfaces through interface communication and refresh the corresponding data. But after reading the document, I did not find a suitable method.Do you know how to deal with it? Thank you.

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

arm linux gcc

What LVGL version are you using?

LVGL 7.4

What do you want to achieve?

I want to realize that when the current interface data has changed, I can tell other related interfaces through interface communication and refresh the corresponding data.

What have you tried so far?

I didn’t find a suitable way, so I didn’t try.

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

If I understand the question correctly, what you are looking for is event callbacks, which are pretty well documented.

https://docs.lvgl.io/latest/en/html/overview/event.html

This type of logic is not provided by LVGL; you are responsible for updating widget data yourself.

However, if you wish to find out when a widget’s value has been changed by the user or it has been pressed, you can use event callbacks as mentioned above.

Thank you for your reply, I read the document, the event delivery seems to have a parent-child relationship or in the same interface. Cannot communicate across screens.

Thank you for your reply。

I’m not sure, if this is what you are looking for : if you call void lv_disp_set_default(lv_disp_t *disp) in the event handler, you can switch the focus to the corresponding display.

Furthermore, before you update a parent component it is helpful to call :

lv_obj_clean(lv_obj_t *parent) and
lv_obj_invalidate(const lv_obj_t *child)

before updating the child.

Thanks for the reply, I will try it。