Skip to main content
Jesper Ronnholm
Associate III
March 21, 2019
Question

How to add extra code in generated classes through application templates

  • March 21, 2019
  • 1 reply
  • 614 views

The ability to package code into application templates is a great feature for preparing platform-specific projects, but it mainly seems to involve adding pre-existing files that are incorporated into the project skeleton. But is there any way to add additional code to the classes that are generated when a new TouchGFX project is created?

Say, for instance, that I wanted the screen-class to inherit from another base class (as a way of seamlessly extending the screen-class functionality) automatically at project creation. Is it possible to do this in the application template rather than having to do it for every new project?

This topic has been closed for replies.

1 reply

Martin KJELDSEN
Principal III
April 2, 2019

There's no direct support for this. In your post-generate command (.touchgfx file) you could call a script to modify each generated file to inherit from another class.