/
getRadioButtonCheck
getRadioButtonCheck
Description
Gets the check value of the radio button user control specified by userControlID
.
Radio buttons are essentially check boxes, but they operate in a group with other radio buttons, allowing for mutually exclusive choices.
Call this command on each radio button in the group to see which has the checked value (if any).
Functional area
User Window
Command syntax
Syntax
getRadioButtonCheck userControlID |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
userControlId | int | yes | ID of user control to operate on. |
Flags
None
Return value
boolean
Examples
// Get 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"`; // Find out which one is checked. if( `getRadioButtonCheck $controlId1` == true ) { print "Radio 1 checked"; } else if(`getRadioButtonCheck $controlId2` == true ) { print "Radio 2 checked"; } else if(`getRadioButtonCheck $controlId1` == true ) { print "Radio 3 checked"; } else { print "None checked"; }
Additional information
Related commands
, multiple selections available,