1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
use strict; use Tk; use Tk::HList; my $mw = MainWindow->new(); my $hlist = $mw->Scrolled( 'HList', -scrollbars => 'osoe', -columns => 3, -header => 1, -width => 100, -height => 30, )->pack(); $hlist->header( 'create',0, -text => 'Name', ); $hlist->header( 'create',1, -text => 'Nummer', ); $hlist->header( 'create',2, -text => 'Wohnort', ); my $entry_name = $hlist->Entry(-text => 'Name suchen...'); my $entry_number = $hlist->Entry(-text => 'Nummer suchen...'); my $entry_place = $hlist->Entry(-text => 'Ort suchen...'); $hlist->add(0); $hlist->item('create',0, 0, -window => $entry_name, -itemtype => 'window',); $hlist->item('create',0, 1, -window => $entry_number, -itemtype => 'window',); $hlist->item('create',0, 2, -window => $entry_place, -itemtype => 'window',); $hlist->add(1); $hlist->item('create',1, 0, -text => 'Otto'); $hlist->item('create',1, 1, -text => '04545-25455'); $hlist->item('create',1, 2, -text => 'Berlin'); $hlist->add(2); $hlist->item('create',2, 0, -text => 'Hans'); $hlist->item('create',2, 1, -text => '04539-49448'); $hlist->item('create',2, 2, -text => 'Frankfurt'); Tk::MainLoop();