Author Topic: Resetting the state of a group of radio buttons  (Read 3550 times)

ferretnt

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
Resetting the state of a group of radio buttons
« on: October 13, 2012, 03:18:39 PM »
What is the correct way to reset the state of a group of radio buttons such that you say "this button is the active one, and all the others should now to inactive."

I also have tweens in/out (driven by OnActivate()) on the buttons, and would like them to be called correctly.

I tried iterating over the n checkboxes and calling OnActivate(true) on the one to be checked, and OnActivate(false) on all others. But this didn't seem to work correctly, in that the one I had then activated didn't then didn't reset when I clicked on a different box.

Is there a different way to handle this? I searched but couldn't find a good answer.

Thanks,
Alex

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Resetting the state of a group of radio buttons
« Reply #1 on: October 14, 2012, 04:44:27 AM »
checkboxYouWantChecked.isChecked = true;

ferretnt

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 23
    • View Profile
Re: Resetting the state of a group of radio buttons
« Reply #2 on: October 14, 2012, 07:53:35 PM »
Thanks! That worked. Didn't spot that was an accessor that triggered everything.