Description
Gets the check value of the check box user control that is specified by userControlID
.
Because check boxes can be created with the -triState
flag (the third state being "indeterminate") a Boolean is not sufficient to accommodate all possible check values. Thus, the command returns an integer: 0 for not checked, 1 for checked, and 2 for "indeterminate".
Functional area
User Window
Command syntax
Syntax
getCheckBoxCheck userControlID |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
userControlId | int | yes | ID of user control to operate on. |
Flags
None
Return value
integer
Examples
// Get the checked value of a Check Box User Control
int $windowId;
int $controlId;
int $checked;
// First create a User Window to place the Control on
$windowId = `createWindow "MyWindow"`;
// Create the User Control on the Window.
$controlId = `createCheckBox $windowId -triState`;
// Get the value on the Check Box.
$checked = `getCheckBoxCheck $controlId`;
if( $checked == 1 )
{
print "Checked";
}
else if( $checked == 0 )
{
print "Unchecked";
}
else
{
print "Indeterminate";
}