cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I have a problem with touchgfx toggle button. The "clicked function" is called when we make interaction. This function is called only when the button is switched on. How can I make a function that is called when we switch off the button ?

ECoud.1
Associate III
 
2 REPLIES 2
TLe.4
Associate II

You can have a boolean or track the state through an enum of whether the button is ON/OFF. This can be done within your screen view .cpp file or presenter file whichever fits your system the best. For example, I just have an enum tracking the state of the button and every time the button is clicked it will change to the other state depending on conditions I set. You are really keeping track of the button yourself and not touchgfx. To change the UI to look responsive I would look at the current state and set the button to the proper color and label to match the state.

ECoud.1
Associate III

Thanks for your help, I will try this.