Thread Tk-Hlist - Zeilen einfärben (6 answers)
Opened by Kean at 2011-05-13 14:45

Kean
 2011-05-16 11:45
#148672 #148672
User since
2004-08-18
463 Artikel
BenutzerIn

user image
Hier ein kleines Beispiel:

Code (perl): (dl )
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
use Tk;
use Tk::HList;

my $mw = MainWindow->new();

my $hl = $mw->Scrolled( "HList",
                        -header => 1,
                        -columns => 3,
                        -scrollbars => 'ose',
                        -selectbackground => '#539FFD',
                                -width => "70",
                        -selectmode => 'extended',
                               )->pack();

$hl->header('create', 0, -text => 'Vorname');
$hl->header('create', 1, -text => 'Name');
$hl->header('create', 2, -text => 'Alter');

$hl->add(0);
$hl->itemCreate(0, 0, -text => "Max");
$hl->itemCreate(0, 1, -text => "Mustermann");
$hl->itemCreate(0, 2, -text => "30");

$hl->add(1);
$hl->itemCreate(1, 0, -text => "Michaela");
$hl->itemCreate(1, 1, -text => "Mustermann");
$hl->itemCreate(1, 2, -text => "28");

MainLoop;

View full thread Tk-Hlist - Zeilen einfärben