use strict; use warnings; use Tk; my $testlbl = 15; my $font = '{New Times Roman} 12'; my $p2 = MainWindow->new; $p2->Label( -width => $testlbl, -text => "Parameter List", -foreground => '#FFFFFF', -background => '#666666', -font => $font, -anchor => 'center' )->grid( -row => 6, -column => 0, -columnspan => 5, -padx => 5, -pady => 0, -sticky => 'ew' ); my $lstbox = $p2->Scrolled( "Listbox", -scrollbars => 'osoe', -selectmode => 'extended', -foreground => '#FFFFFF', -background => '#7E7E68', -font => $font, -width => 40 )->grid( -row => 7, -column => 0, -columnspan => 5, -padx => 5, -pady => 0, -sticky => 'nsew' ); $lstbox->Subwidget("corner")->configure( -background => '#666666' ); $lstbox->Subwidget("xscrollbar")->configure( -background => '#666666' ); $lstbox->Subwidget("yscrollbar")->configure( -background => '#666666' ); $lstbox->bind( '' => sub { $lstbox->focus } ); $lstbox->bind( '' => \&Deltxt ); $lstbox->insert( 'end', $_ ) for ( 1 .. 20 ); MainLoop; sub Deltxt { return unless my @indicies = $lstbox->curselection; $lstbox->delete( $_ ) for @indicies; }