#!/usr/bin/perl use strict; use warnings 'all'; use Tk; my $mw = tkinit; my $tf = $mw->Frame()->pack(qw/-fill both -expand 1/); my @lb; push(@lb, $tf->Listbox(-exportselection => 0)->pack(-side => "left")); push(@lb, $tf->Listbox(-exportselection => 0)->pack(-side => "left")); push(@lb, $tf->Listbox(-exportselection => 0)->pack(-side => "left")); foreach (@lb) { $_->insert('end',"Test" ); $_->insert('end',"Test1"); $_->insert('end',"Test2"); $_->insert('end',"Test3"); } $mw->Button(-text => "Werte ausgeben", -command => sub { foreach my$lb (@lb) { my @selected = $lb->curselection; my $werte = "Werte: "; $werte .= $lb->get($_) foreach @selected; print "$werte\n"; } })->pack(qw/-fill x -expand 1 -anchor n/); MainLoop;