Skip to main content
Senior
April 24, 2025
Solved

Screen code not generated by TouchGFX unless the screen is used/called?

  • April 24, 2025
  • 1 reply
  • 497 views

Hi,

it seems that unless I make some transition to a specific screen within touchGFX (i.e. a button changing another screen to the screen in question), then TouchGFX does not generate any code for that screen (view, presenter, etc).

I guess it makes sense in order to save memory. But I want to transition to that screen programmatically so I do need all the code to be generated for that screen.

Is there some other way to force TouchGFX to generate the code for that screen?

Thank you

Ricko_0-1745477897243.png

 

Best answer by GaetanGodart

Hello @Ricko ,

 

You could create an interaction where the trigger will never happen and the action is to switch to screen X, this way you get your code generated.

One way to add a trigger that will never be called is to select the "hardware button clicked" (as long as you don't use a physical keyboard in your final project):

GaetanGodart_0-1745486923498.png

Alternatively, you could create an action on the screen and use that action as a trigger (this action will never be called if you don't do that yourself) :

GaetanGodart_1-1745486966458.png

 

Regards,

 

1 reply

GaetanGodart
GaetanGodartBest answer
Technical Moderator
April 24, 2025

Hello @Ricko ,

 

You could create an interaction where the trigger will never happen and the action is to switch to screen X, this way you get your code generated.

One way to add a trigger that will never be called is to select the "hardware button clicked" (as long as you don't use a physical keyboard in your final project):

GaetanGodart_0-1745486923498.png

Alternatively, you could create an action on the screen and use that action as a trigger (this action will never be called if you don't do that yourself) :

GaetanGodart_1-1745486966458.png

 

Regards,

 

RickoAuthor
Senior
April 25, 2025

Thank you again @GaetanGodart  :)

GaetanGodart
Technical Moderator
April 25, 2025

My pleasure! :)