2021-05-04 05:17 AM
I have a toggle button widget directly dragged from TouchGFX designer to the UI.
I am unable to manually set the state of the toggle button to True/False using the ForceState (it just flashes between True/False every time I set the state )
Is there a way to i.e. setState() the toggle button and update it's corresponding image?
Thanks...
Solved! Go to Solution.
2021-05-04 05:54 AM
Hi,
Could you share your code ? Just to be sure have you made sure you used the .invalidate function after changing the state of the button ?
/Romain
2021-05-04 05:54 AM
Hi,
Could you share your code ? Just to be sure have you made sure you used the .invalidate function after changing the state of the button ?
/Romain
2021-05-04 06:15 AM
This is exactly what I have left out :grinning_face_with_sweat:
Now everything is working as expected
I updated my code to this
void Container_MiniStatus::setToggleButtonState(bool value)
{
toggleButton1.forceState(value);
toggleButton1.invalidate(); //ADDED LINE
}
2021-05-04 07:10 AM
perfect :beaming_face_with_smiling_eyes: