/
setRadioButtonCheck
setRadioButtonCheck
Description
Sets the check value of the radio button user control that is specified by userControlID
.
Radio buttons are essentially check boxes, but they operate in a group with other radio buttons, allowing for mutually exclusive choices. When a user interacts with radio buttons in a group, the radio buttons automatically uncheck themselves when another button in the group is checked. However, when setting the check with this command, you must explicitly uncheck any other radio buttons in the group, otherwise, multiple buttons may be checked.
Functional area
User Window
Command syntax
Syntax
setRadioButtonCheck userControlID checkBoolean |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
checkVal | boolean | yes | The check value of this radio button. |
userControlId | int | yes | ID of user control to operate on. |
Flags
None
Return value
boolean
Examples
// Set the checked value of a Radio Button User Control int $windowId; int $controlId1, $controlId2, $controlId3; int $rect[ 4 ]; // First create a User Window to place the Controls on $windowId = `createWindow "MyWindow"`; // Create the User Controls on the Window. Check the middle one. $rect[ 0 ] = 20; $rect[ 1 ] = 20; $rect[ 2 ] = 100; $rect[ 3 ] = 40; $controlId1 = `createRadioButton $windowId -pos $rect -text "Radio 1"`; $rect[ 1 ] = 50; $rect[ 3 ] = 70; $controlId2 = `createRadioButton $windowId -pos $rect -text "Radio 2" -check`; $rect[ 1 ] = 80; $rect[ 3 ] = 100; $controlId3 = `createRadioButton $windowId -pos $rect -text "Radio 3"`; // Now check the last one, making sure to uncheck the middle one we // checked before setRadioButtonCheck $controlId1 false; setRadioButtonCheck $controlId2 false; setRadioButtonCheck $controlId3 true;
Additional information
Related commands
, multiple selections available,