use Tk; use Tk::JComboBox; my $ScreenSize = "300x200+0+0"; &Screen; MainLoop; sub Screen { $MainScreenObject = MainWindow->new(-background =>"white"); $MainScreenObject->geometry($ScreenSize); @TestList = ('12','123','12345'); $test= createComboBox('Test',5,100,50); $test1= createComboBox('Test1',5,100,100); } sub onTestComboBoxSelect { @TestList1 = ('1','3','125'); $test1->configure(-choices => \@TestList1 ,-state => 'normal'); } sub onTest1ComboBoxSelect { } sub createComboBox { my($ComboBoxName,$Width,$x,$y) = @_; $ComboBoxName =~ s/\s+//g; my $ComboBoxObject = $MainScreenObject->JComboBox(-background =>'white', -textvariable => \${$ComboBoxName}, -choices => \@{$ComboBoxName."List"}, -browsecmd =>\&{"on".$ComboBoxName."ComboBoxSelect"}, -entrywidth =>$Width,)->place(-x=>$x,-y=>$y); return($ComboBoxObject); }