How to implement "SwitchScreen()" in touchgfx?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-03-28 6:13 AM
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;
Solved! Go to Solution.
- Labels:
-
TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-21 3:42 AM
Solved. I had to add
#include <gui/common/FrontendHeap.hpp>
in FrontendApplication.c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-08-12 8:18 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-22 5:32 PM
Martin,
I want to change from screen1 to screen2 in my Virtual Function. How do I call:
gotoScreen1ScreenNoTransition();
From Screen1View?
#include <gui/screen1_screen/Screen1View.hpp>
#include <gui_generated/common/FrontendApplicationBase.hpp>
void Screen1View::buttonClicked10s()
{
buttonNumActive=10;
//application().gotoScreen2ScreenNoTransition();
static_cast<FrontendApplication*>(Application::getInstance())->gotoScreen2ScreenNoTransition();
}
undefined reference to `Screen1View::gotoScreen2ScreenNoTransition()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-11-25 5:06 AM
Hello @FJB2069 ,
All the transitions are not created automatically. If you want to be able to call a function to change a screen, you first need to create an interaction with that screen change. So for instance, create an interaction to go from screen1 to screen 2.
You can see an example of it in this video .
Regards,
Software engineer at ST (TouchGFX)

- « Previous
- Next »