sub TabulateModules{
print "TabulateModules\n";
print "=================\n";
my $paneModules = $_[0];
my $Index = 0;
my $ModuleButtonReference = 0;
if (@ModuleButtonarray){
foreach my $array (@ModuleButtonarray){
$array->packForget();
}
}
@ModuleButtonarray = ();
@cbvalue = ();
###Debug : To remove
@aModules = ("tt", "kl");
unshift(@aModules, "Select all");
foreach my $Modules (@aModules){
$ModuleButtonReference = $paneModules->Checkbutton(
-text => "$Modules",
-variable => \$cbvalue[$Index],
-onvalue => 1,
-offvalue => 0,
-font => 'big',
-foreground=>'black',
-bg => 'DimGray',
)->pack(-side=>'top',-anchor=>'sw' );
$Index++;
push(@ModuleButtonarray, $ModuleButtonReference);
}
}
Please Note : The "paneModules" is a scrolled pane.
Description : In this snippet, Im creating a list of check button.
For selecting all the check button at one go, I added one more item to the list say "Select all".
My query is : if the check button "Select all" is selected, all other check box should also get selected and I want the checked items in a list.How can this be done?
|