Hello Everyone,
I have three buttons and I'm trying to implement an event which is only possible to select one at a time. It would be similar to a radio box.
I'm using the button class available in gitHub. The problem is that I don't know how instantiate the class button to update the state.
Many thanks.
English isn’t my first language, so please excuse any mistakes.
Comments
-Define a global variable like btn1selected. set it to false in the beginning.
-On press of your any button set it to true.
-In the beginning of every on press button check this variable(btn1selected) with an if. if true it means that user already selected on of the buttons. so simply deactivate other two and select yours.
http://giderosmobile.com/forum/discussion/1456/button-onoff-state/p1
So by using this code and the idea above it seems easy.
Here is an example project with a new class "Togglebutton" that does just that
Just ask if you have questions
Likes: Thuwiz
@antix - That was perfect and works exactly as I wanted.
Thanks everyone for the help.
Likes: antix