Debian Codegraph @

demos/tagBorderWidth

raw
1 # Script show the new multi-number borderwidth option for tags
2 # Borderwidth can be specified as a space separated list of
3 # 4 numbers representing left right top bottom borders drawn in a cell
4 #
5 # In this example, the tag'ed row will have a large top/bottom border, and a normal
6 # size left/right border
7
8 use Tk;
9 use Tk::TableMatrix;
10
11 use strict;
12
13 my $mw = MainWindow->new;
14
15 #$mw->optionAdd('*background', 'blue', 'interactive');
16 $mw->optionAdd('*tablematrix*background', 'skyblue');
17
18 my $table = $mw->TableMatrix(-rows => 5,
19 -cols => 8,
20 -cache => 1,
21 #-bg => 'blue',
22 );
23 $table->pack(-expand => 1, -fill => 'both');
24
25 $table->tagConfigure("invalid", -background => 'red', -relief => 'raised', -bd => '1 1 5 5');
26 $table->tagConfigure("left", -anchor => 'w');
27
28 foreach my $row (0..4) {
29 #$table->tagRow('invalid', $row); # swap
30 foreach my $column (0..7) {
31 $table->set("$row,$column", "hello");
32 #$table->tagCell('left', "$row,$column"); # swap
33 }
34 }
35
36 $table->tagCell('left', '2,3');
37 $table->tagRow('invalid', 2);
38
39 MainLoop;