#!/Perl/bin/perl use strict; use warnings; use Tk; use Tk::Listbox; my $mw = Tk::MainWindow->new(-width => 400, -height => 400,); $mw->packPropagate(0); my @werte = qw(1 2 3 4 5 6); my $listbox = $mw->Scrolled('Listbox', -scrollbars => 'e', -height => 5, -listvariable => \@werte, )->pack(-side => 'left', -fill => 'y',); my $label = $mw->Label(-text => 'click a listbox-value', -bg => 'green',)->pack(-fill => 'x',); $listbox->bind('<>', sub{ $label->configure(-text => $listbox->get($listbox->curselection()),); },); $mw->MainLoop();