Debian Codegraph @

examples/mcHL

raw
1 use Tk;
2 use Tk::widgets qw(HList);
3 my $mw = MainWindow->new();
4
5 # print "'",join("'\n'",$mw->fontFamilies),"'\n";
6
7 my $hl = $mw->HList(-columns => 3, -header => 1,
8 -font => 'times -36'
9 )->pack(-fill => 'both', -expand => 1);
10
11 my $f = $hl->cget('-font');
12 print '"',join('","',$mw->fontActual($f)),"\"\n";
13
14 $hl->headerCreate(0,-text => "one\x{800}\x{fffd}");
15 $hl->headerCreate(1,-text => 'two');
16 $hl->columnWidth(1,-char => 5);
17 $hl->headerCreate(2,-text => 'three');
18
19 for (my $i = 0; $i < 10; $i++)
20 {
21 $hl->add($i, -itemtype => 'text', -text => "Item$i\x{20ac}");
22 $hl->itemCreate($i,1, -text => chr(ord('a')+$i)."$i" x 12);
23 $hl->itemCreate($i,2, -text => "c2$i" x 12);
24 }
25
26 MainLoop;