Check box


#1

If i click on test, only test1 is selecting remaining not selected
any one please give the solution when i click on test all checkboxes need to selected.

window -title “test win” Test;
window -e -wh 250 500 -rtf true Test;
frameLayout -l “Layers” -cll 1 -cl 1 -bs “etchedIn”;
columnLayout -adj 1;

checkBox -l “Test” -cc “checkBox -e -v (checkBox -q -v b) bgg” a;
checkBox -l “Test1” -v (checkBox -q -v a) b;
checkBox -l “Test2” -v (checkBox -q -v a) c;
checkBox -l “Test3” d;

button -l “Generate” -c “layer”;

showWindow Test;


#2

Please use the ‘#’ symbol to format the code, it is simply easier to read.
Well, concerning your question:
The solution is already in the code. You wrote:

checkBox -l "Test" -cc "checkBox -e -v (`checkBox -q -v b`) bgg"  a;

What is not nice but almost correct. I suppose you want “bgg” to be “b” but this would not help because then with a click on checkbox a, checkbox b is changed with the value of checkbox b. What you need is to set the values of checkbox b - e with the value of checkbox a:

checkBox -l "Test" -cc "checkBox -e -v (`checkBox -q -v a`) b"  a;

And for the others:

checkBox -l "Test" -cc "checkBox -e -v (`checkBox -q -v a`) b;checkBox -e -v (`checkBox -q -v a`) c;checkBox -e -v (`checkBox -q -v a`) c;checkBox -e -v (`checkBox -q -v a`) d"  a;

This should work but it is not really nice. You should use a global proc to seperate the modification:

global proc testProc():
{
	 int $v = `checkBox -q -v a`;
	checkBox -e -v $v b; 
	checkBox -e -v $v c; 
 	checkBox -e -v $v d; 
 } 

And use this in your cc command:

checkBox -l "Test" -cc testProc a;
  

#3

Thnxs Dude… :wavey: