Simple example to demonstrate use of a Wildcard on TouchGFX
Hi.
Is there a simple, complete example on how to use a Wildcard that can populated in real-time with custom values? That is, change a counter every few seconds or similar.
For example, reading from an I2C widget and then print onto the display?
So far, have most of the day invested to learn but failing. What a painful exercise this has become.
Here is what I have so far:
1) Used TouchGFX to create a textArea1 with Wildcard1 -> wildcard buffer set to 10.
2) Initial value is blank.
3) After much trial and error, able to print my value using the following code:
Screen1View.cpp
#include <gui/screen1_screen/Screen1View.hpp>
#include <texts/TextKeysAndLanguages.hpp>
#include <touchgfx/Color.hpp>
#include "stm32f4xx_hal.h" // Keil::Device:STM32Cube HAL:Common
Screen1View::Screen1View()
{
}
void Screen1View::setupScreen()
{
textArea1.setTypedText(TypedText(T_SINGLEUSEID1));
textArea1.setXY(88, 180);
textArea1.setColor(Color::getColorFrom24BitRGB(0xFF, 0xFF, 0xFF));
textArea1.setWildcard(txtBuffer);
add(textArea1);
updateTxt(129);
updateTxt(315);
}
void Screen1View::updateTxt(int newValue)
{
Unicode::snprintf(txtBuffer, 10, "%d", newValue);
textArea1.setWildcard(txtBuffer);
textArea1.resizeToCurrentText();
textArea1.invalidate();
}
void Screen1View::tearDownScreen()
{
}The above works to print 315 onto the screen.
Q1: How to update the above after a period of time?
Q2: Is there a simple code sample that will demonstrate counting from 0..9 to the above textArea1 wildcard?
Is the solution to create a new FreeRTOS thread and make repeated calls to the above after a period of time?
It appears that HAL_Delay(xx) cannot be used here. Tried to insert HAL_Delay(100) between lines 19-20 and failed to work to see 129 -> then 315.
Also, why does 315 stay statically posted onto the screen after compiling and reflashing?
Expected to see 129 and then 315.
The documentation is severely lacking. Where are the referenced code examples from the Draupner website? They do not appear to be posted inside the 4.10 toolchain.
ie. from
https://touchgfx.zendesk.com/hc/en-us/articles/207015345
https://touchgfx.zendesk.com/hc/en-us/articles/207015345-Using-texts-and-fonts
Where can the following reference example be found? Guessing it is no longer supplied in the current distribution.

This toolchain requires complete and concise code examples of "how to".
A good product manual should have started with a simple "Hello World" but instead, came across C++ functions:
https://www.touchgfx.com/documentation/html/index.html
How about full examples on how to use each of these functions?
No problems in using the GUI tool, interactions, printing via button clicks / callbacks but this wildcard is something else.
There must be something that I am missing or is that the only available documentation?
Printing to the screen should not have consumed the better part of the day.
Extremely frustrated with this current experience.
