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 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-26 4:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-26 9:43 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-04-27 5:09 AM
Thanks for your help, I will try this.
