Skip to main content
Associate
June 24, 2025
Solved

TouchGFX - read displayed value and operate in dependency of it

  • June 24, 2025
  • 2 replies
  • 303 views

Hello all, 

I am really new to TouchGFX and can't find a solution to my problem. 

I want to increase or decrease a displayed value on my screen by clicking on a button. 

I think I have to read the value each time by using getWildcard(). But now I have a data type conflict as I can't just handle it as an int and increase it. In the following you can see a picture of my screen. 

Thank you in advance :) 

Alx237_0-1750768277539.png

 

Best answer by jumman_JHINGA

Hii @Alx237 

if you using Text Area for increasing and decreasing the values.

1. Enable Wild Card buffer for your text area.

2. you have take one static variable ... based on UP & DOWN button you have to increase or decraese the value of static variable.

3. using  Unicode::snprintf(taBuffer, TA_SIZE, "%d ", variable); you can update value on screen.

4. after every update you need to call ta.invalidate(); 

2 replies

jumman_JHINGA
jumman_JHINGABest answer
Senior III
June 24, 2025

Hii @Alx237 

if you using Text Area for increasing and decreasing the values.

1. Enable Wild Card buffer for your text area.

2. you have take one static variable ... based on UP & DOWN button you have to increase or decraese the value of static variable.

3. using  Unicode::snprintf(taBuffer, TA_SIZE, "%d ", variable); you can update value on screen.

4. after every update you need to call ta.invalidate(); 

GaetanGodart
Technical Moderator
June 24, 2025

Hello @Alx237 and welcome to the community!

 

You have to store your data as an int, increment or decrement that int and then display it.

Have a look at the TouchGFX Academy where we provide tutorials and video guides.

Please find attached an example of incrementing and decrementing value.

 

Regards,