Leser: 2
|< 1 2 3 >| | 22 Einträge, 3 Seiten |
Quote(ptk) Zum Problem: ich glaube, du solltest ein bisschen mit der globalen und den Item-spezifischen Hintergrundfarben experimentieren. Die globale setzt man mit $hlist->configure(-bg => ...), bei den itemspezisischen hilft ein Blick in die Tk::DItem-Dokumentation.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
sub show_box_content {
$shelf_content -> deleteAll;
my @content = &get_box_content($_[0]);
my $i = 0;
#styles for the single rows
my $greyStyle = $shelf_content -> ItemStyle('text', -background => 'lightgrey', -font => 'Arial 8 bold', -foreground => 'black');
my $defaultStyle = $shelf_content -> ItemStyle('text', -font => 'Arial 8 bold', -foreground => 'black');
#give a value for shelf-hlist
for (@content) {
#print "Boxdate: $content[$i][0]\nBoxname: $content[$i][1]\nBoxdescribe: $content[$i][2]\n";
$shelf_content -> add($i, -data => $content[$i][2]);
$shelf_content -> itemCreate($i, 0, -text => $content[$i][0], -style => ($i % 2) ? $defaultStyle : $greyStyle);
$shelf_content -> itemCreate($i, 1, -text => $content[$i][1], -style => ($i % 2) ? $defaultStyle : $greyStyle);
$i++;
}
} #show_box_content
1
2
3
4
5
6
my $hlist = $main -> HList(-sizecmd => [\&resize,$hlist]);
sub resize {
my ($hlist) = @_;
print $hlist->width();
}
|< 1 2 3 >| | 22 Einträge, 3 Seiten |