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
#!perl
use strict;
use warnings;
use Tk;
use Tk::HList;
my $mw = tkinit();
my $hl = $mw->HList(
-header => 1,
-columns => 2,
-height => 15,
-selectbackground => '#539FFD',
-width => "70",
-selectmode => 'extended',
-browsecmd => sub{
print "hi";
},
);
$hl->header('create', 0, -text => 'ID');
$hl->header('create', 1, -text => 'Name');
$hl->pack();
for( 0 .. 100 ) {
my $e = $hl->addchild("");
$hl->itemCreate($e, 0, -itemtype => 'text', -text => $_);
$hl->itemCreate($e, 1, -itemtype => 'text', -text => $_ * 2);
}
$mw->MainLoop();