cancel
Showing results for 
Search instead for 
Did you mean: 

How do I change the current screen that is visible on LCD using code, and what is the correct way to switch screens should it be done on the hardware (main) side or in the model?

Jloda.11
Associate II
 
2 REPLIES 2
Yoann KLEIN
ST Employee

Hello @Jloda.1​ ,

To switch from a screen to another programmatically, you have to use one of the "Switch screen" functions (e.g. gotoScreen2ScreenSlideTransitionEast()).

I recommend you to call those functions from your ScreenView.cpp class.

I already answered to a similar question a few months ago, please check it.

Please let me know if it helped you,

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX
Jloda.11
Associate II

So here is what I have done until now:

I have a very big GUI with 20 to 30 screens, So to generate functions for changing screens I have added blank interaction for screen change for all screens in one screen then I have included that screen's header in model.

then for every button press I have pushed it into a queue and process that in main.c and then using another queue it has gone to the model and using switch case I have changed the screen.

but the screen transition seems laggy and slow since model only runs at rendering of frame I want to change screen from main.c but the touch gfx file are .cpp so it gives error if I include those files in main.c

So I want a way to change the screens from main.c