File: tagBorderWidth

package info (click to toggle)
libtk-tablematrix-perl 1.23-6
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,788 kB
  • sloc: ansic: 15,026; perl: 3,389; makefile: 120; sh: 16
file content (41 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download | duplicates (5)
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
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/perl

# Script show the new multi-number borderwidth option for tags
#   Borderwidth can be specified as a space separated list of 
#     4 numbers representing left right top bottom borders drawn in a cell
#
#   In this example, the tag'ed row will have a large top/bottom border, and a normal
#     size left/right border

use Tk;
use Tk::TableMatrix;

use strict;

my $mw = MainWindow->new;

#$mw->optionAdd('*background', 'blue', 'interactive');
$mw->optionAdd('*tablematrix*background', 'skyblue');

my $table = $mw->TableMatrix(-rows => 5,
                            -cols => 8,
                            -cache => 1,
			    #-bg => 'blue',
			    );                
$table->pack(-expand => 1, -fill => 'both');

$table->tagConfigure("invalid", -background => 'red', -relief => 'raised', -bd => '1 1 5 5');
$table->tagConfigure("left", -anchor => 'w');

foreach my $row (0..4) {
     #$table->tagRow('invalid', $row);                # swap
     foreach my $column (0..7) {
       $table->set("$row,$column", "hello");
             #$table->tagCell('left', "$row,$column");    # swap
   }
}

$table->tagCell('left', '2,3');
$table->tagRow('invalid', 2);

MainLoop;