DirectRadioButton command parameter

If you pass a function into the command parameter of a DirectRadioButton, that function will be called when the button is clicked, passing a 0 or a 1, depending on the state of the button. I have two questions about this functionality.

  1. What does the passed parameter mean. Does 1 mean the button is selected and 0 mean it isn’t selected?
  2. Will the passed parameter ever not be a 1?

Passed parameter will be always 0 or 1 indicating that radio button is selected or not.

But if same function is used for several radio buttons, like the example in the manual, that parameter is meaningless.

So in that case, you need to check the value of the variable, the one you specified when you create the radio button, to see which button is selected since that variable will be updated when you select the radio button.

If you specify different function for each individual radio button, you can use the passed parameter to indicate that button is selected or not.

Isn’t the command for a particular button called, by definition, only when that button is selected?

Actually, a radio button will be unchecked by selecting the other button in the group, so the passed parameter will be always 1.

Always meaningless. :blush:
We might need to change radio button not to pass any parameter.

I’ve changed DirectRadioButton not to pass parameter except extraArgs.