use Tk; use Tk::BrowseEntry; my $top=MainWindow->new(); $top->title("Match Specifications"); my @names=('Last Name','First Name','Not a name'); my $value=2; #no name is default my $indicator=0;#start looping over names, indicator=0=>Last, 1=>first, 2=>no name %main::A={1=>['Tim','Doe','other_info1'], 2=>['Mick','Lu','other_info_2']}; %main::B={1=>['Timothy','Doe','other_info1','moreinfo1'], 2=>['Michail','Lu','other_info_2','moreinfo2']}; $main::headers[0]=['F','L','O']; $main::headers[1]=['M','J','P','JJ']; my $fr=$top->Frame(-relief=>'sunken')->pack(-anchor=>'nw',-fill=>'both'); my $counter0=0; my @selector; my $col=0;my $colshow=0; my @keys00=sort keys %main::A;my @keys0=(); push @keys0,$keys00[0]; push @keys0,$keys00[1]; my @keys200=sort keys %main::B; my @keys20=(); push @keys20,$keys200[0]; push @keys20,$keys200[1]; my $row1=0; foreach my $el(@{$main::headers[0]}){ my $row=0; $selector[$col]=$fr->Scrolled('BrowseEntry',-label=>$el,-variable=>\$main::matchhash{$col}, -browsecmd=>[\&show,$el,\@headers2,\@keys200]); my $h2cnt=0 ; my $h2cntall=0; ##### this is the part that must be repopulated dynamically foreach my $el2(@{$main::headers[1]}){ $selector[$col]->insert("end", $el2); $h2cnt++; $h2cntall++;}#foreach el2 $selector[$col]->grid(-row=>$row,-column=>$colshow); #### end of part to repopulate dynamically $row++; #row nonzero $fr->Label(-text=>$main::A{$keys0[0]}->[$col])->grid(-row=>$row,-column=>$colshow);$row++; $fr->Label(-text=>$main::A{$keys0[1]}->[$col])->grid(-row=>$row,-column=>$colshow);$row++; foreach my $name(@names){ $fr->RadioButton( -text=>$name,-variable=>\$indicator,-value=>$value)->grid(-row=>$row, -column=>$colshow); $row++;} $colshow++; $row1=$row; $col++;}#foreach el ####### $fr->Button(-text=>'Run',-bg=> 'firebrick1' ,-command=>sub{ } )->grid(-row=>$row1,-column=>1); &MainLoop(); sub show{my $el=shift; my $rheaders=shift; my $rkeys=shift; }