Radiobuttons -en false and then set to true?

Radiobuttons -en false and then set to true?

Anonymous
Not applicable
363 Views
1 Reply
Message 1 of 2

Radiobuttons -en false and then set to true?

Anonymous
Not applicable
hi,
i am trying to set up a UI that has 2 sets of radioCollections. depending on the state of the first set, the second will become enabled or not.
cant get the second set to become enabled. here is the code:



{
window;
columnLayout;

// create the first radio collection
$radio1 = `radioCollection`;

// add some radio buttons to the collection
$off = `radioButton -label "Off" -onc "updateradio(0)"`;
$on = `radioButton -label "On" -onc "updateradio(1)"`;

separator -w 50 -style "single";

// create the second radio collection
$radio2 = `radioCollection`;

// add some radio buttons to the collection
$X = `radioButton -label "X" -en false`;
$Y = `radioButton -label "Y" -en false`;
$Z = `radioButton -label "Z" -en false`;

// edit the radio collections to set the required radio button
radioCollection -edit -select $off $radio1;


proc updateradio(int $arg) {
if($arg){
radioButton -en true $X;
radioCollection -edit -select $X $radio2;
}
}

// now show the window
showWindow;
}



thanks
-a
0 Likes
364 Views
1 Reply
Reply (1)
Message 2 of 2

lee.dunham
Collaborator
Collaborator
I had issues with your code, not passing the radioButton strings to the proc so i rewrote it how I would have.

Im assuming this is how you wanted it to work.

if(`window -ex rb_test_win`)
deleteUI rb_test_win ;
window rb_test_win ;
columnLayout ;
radioCollection rCollection01;
radioButton -label "On" -onc "updateradio 1";
radioButton -label "Off" -onc "updateradio 0" -sl;
separator -w 50 -style "single";
radioCollection rCollection02;
radioButton -label "X" -ed 0 X_rButton;
radioButton -label "Y" -ed 0 Y_rButton;
radioButton -label "Z" -ed 0 Z_rButton;
setParent.. ;
showWindow rb_test_win ;

proc updateradio(int $arg)
{
radioButton -e -en $arg -sl X_rButton;
radioButton -e -en $arg Y_rButton;
radioButton -e -en $arg Z_rButton;
}
0 Likes