Debian Codegraph @

demos/tagMerge

raw
1 # Script show tag merging behavior with an option set in the
2 # option database.
3 #
4 # Should display with one row hightlighted red and a cell in the row left-justified
5
6 use Tk;
7 use Tk::TableMatrix;
8
9 use strict;
10
11 my $mw = MainWindow->new;
12
13 #$mw->optionAdd('*background', 'blue', 'interactive');
14 $mw->optionAdd('*tablematrix*background', 'skyblue');
15
16 my $table = $mw->TableMatrix(-rows => 5,
17 -cols => 8,
18 -cache => 1,
19 #-bg => 'blue',
20 );
21 $table->pack(-expand => 1, -fill => 'both');
22
23 $table->tagConfigure("invalid", -background => 'red');
24 $table->tagConfigure("left", -anchor => 'w');
25
26 foreach my $row (0..4) {
27 #$table->tagRow('invalid', $row); # swap
28 foreach my $column (0..7) {
29 $table->set("$row,$column", "hello");
30 #$table->tagCell('left', "$row,$column"); # swap
31 }
32 }
33
34 $table->tagCell('left', '2,3');
35 $table->tagRow('invalid', 2);
36
37 MainLoop;