cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement "SwitchScreen()" in touchgfx?

kvkhekale
Associate II

Hello all,

I am trying to switch the screen throuch code in touchgfx.

If I use SwitchScreen, how shall I state the argument (screen* newScreen)?

If, for example I want to switch to Screen7.

Shall I call the function with SwitchScreen(scr7)?

where scr7 is declared as follows:

ScreenView7 scr7;

31 REPLIES 31

Solved. I had to add

#include <gui/common/FrontendHeap.hpp>

in FrontendApplication.c

But you would not be able to call

static_cast<FrontendApplication*>(Application::getInstance())->gotoScreen1ScreenNoTransition();

from .c code. How could you circumvent that, could you write a c-calling convention compatible wrapper inside FrontEndApplication.cpp which would call gotoScreen1ScreenNoTransition() directly? Could this be for example done by writing a function outside the class that woudl have access to the instantiated object and place that between extern "c" brackets?

I wish that I could program everyghing in either .cpp or .c, but with FreeRTOS and TouchGFX one has little choice.