Best practise for creating a program with multiple screens


I am trying to create a program with many screens (think like one of these installation wizards)… It’s kind of similar to the printer demo but with more screens (about 10)…

In the printer demo, only one screen object is created, and then during runtime objects are created and deleted using callback functions and animations.

I feel like this makes the program considerably harder to write as there doesn’t seem to be a standard way of organising the program flow.

An alternative I had thought about was creating separate screen objects for each of my screens, and then using button callbacks just to switch the active screen (like in the Edgeline phone demo on YouTube).

Is this good practise, or are screens not meant to be used that way? Is there a guideline onto creating programs with multiple screens (as opposed to the typical dashboard style program)?

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

Cypress PSoC

What LVGL version are you using?


After some experimentation, I found it most practical to populate the first screen manually, then use button callbacks and occasionally FreeRTOS synchronised Tasks to populate the rest.

No need to plan out all screens in advance. Just let the program clear the screen with lv_obj_clean(lv_scr_act()); and draw the screens in real time. Similar to how it was done in the printer demo.