#!perl use strict; use warnings; use utf8; use Tk; my $mw = Tk::MainWindow->new(); my $zahl = 42; my $hlist = $mw->HList( -width => 50, )->pack(-fill => 'both', -expand => 1); $mw->Button( -text => 'deselect', -command => sub{ $hlist->selection('clear'); return 1; }, )->pack(-fill => 'x',); foreach( (qw(1 2 dkhj dfhgf dfskh sd)) ) { my $l = $hlist->addchild(''); $hlist->itemCreate($l, 0, -itemtype => 'text', -text => $_); } $mw->MainLoop();