2022-01-14 05:52 AM
Hi there !
i'm gonna to 'play' with touchgfx , and after a help from community ii'm going to make my first program. And here i'm first problem. I wanto to change the name of a button after i touch and right now i just try to wrote that :
void Screen1View::btn1(){
buttonWithLabel1.setLabelText(touchgfx::TypedText('t'));
buttonWithLabel1.invalidate();
}
and i have a couple of question:
1) dosen't work and afther the first touch the button look like continus to be push
2) i want write one phraselike Stop but i don't know how to do
I hope some one can help me
Have a good day
Sergio
Solved! Go to Solution.
2022-01-17 01:33 AM
Hi,
I would not recommend to use the buttonWithLabel in that way, not sure it works. I would instead use the Ressource text source solution as done in the "Text Example" UI which you can find when creating a new project in the Example tab. In this demo the text source within the buttonWithLabel is not a Single Use but a Ressource, so already set within the text tab in Designer. It is easier to change and won't break your project.
Otherwise I would recommend to use a flex button widget and add the images and the text to mimic a buttonWithLabel widget. The flex button should be easier to manipulate.
Concerning your 2nd question, could you elaborate ? I am not sure I understand what you want to do.
/Romain
2022-01-17 01:33 AM
Hi,
I would not recommend to use the buttonWithLabel in that way, not sure it works. I would instead use the Ressource text source solution as done in the "Text Example" UI which you can find when creating a new project in the Example tab. In this demo the text source within the buttonWithLabel is not a Single Use but a Ressource, so already set within the text tab in Designer. It is easier to change and won't break your project.
Otherwise I would recommend to use a flex button widget and add the images and the text to mimic a buttonWithLabel widget. The flex button should be easier to manipulate.
Concerning your 2nd question, could you elaborate ? I am not sure I understand what you want to do.
/Romain
2022-01-17 05:39 AM
Thank you soo much, About the second question it was just an example about what i want wrote.
again thanks a lot
Sergio