cancel
Showing results for 
Search instead for 
Did you mean: 

Tutorial 2: Call New Virtual Function Overwriting Code

KMew
Senior III

I am new to TouchGFX and STM32 programming, so I apologize if any obvious details are missed.

I am attempting to run Tutorial 2 in the TouchGFX tutorial (Because I'm a new member, I cannot add the link, but it's the TouchGFX Version 4 19 tutorial guide, Tutorial 2)

I have successfully run up to "Step 4: Adding Code."

I completed up to the step where it asks you to create the "buttonDown" interaction on the TouchGFX Designer (I'm running on 4 19 1).

I generate the code without issue, then it asks me to open MainViewBase.hpp (I was trying several screens, so mine is called Screen4ViewBase.hpp).

When I add the recommended code to display the "buttonUpClicked" and "buttonDownClicked" text pop up, I hit the "Run Simulation" button on the TouchGFX Designer and the code that I wrote disappears, so the text obviously does not appear.

Am I doing something wrong?

1 ACCEPTED SOLUTION

Accepted Solutions

No this files is modified by generator when you move or change object in designer.

You can place code here, but every generation remove it.

Normal place code into folder GUI

View solution in original post

4 REPLIES 4
MM..1
Chief III

Base file is generated code, and every Simulate or Generate click overwrite all generated files.

All your user code need be placed into GUI files Screen4View.hpp or cpp and other.

Hello, thank you for the reply!

Just to make sure I understand, these are the files that I should modify, correct?

If so, these are the ones I tried and they are being overwritten.

0693W00000QNaE4QAL.png

No this files is modified by generator when you move or change object in designer.

You can place code here, but every generation remove it.

Normal place code into folder GUI

Just tried using the GUI folder and finding the same code. It solved the overwriting problem.

Thank you very much for the help!