File: taint_test

package info (click to toggle)
perl-tk 1:800.025-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 18,444 kB
  • ctags: 19,081
  • sloc: ansic: 206,740; perl: 40,187; makefile: 4,371; sh: 2,373; yacc: 762
file content (43 lines) | stat: -rw-r--r-- 1,345 bytes parent folder | download | duplicates (11)
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
42
43
#!/usr/bin/perl
use strict;
use Tk;
use Tk::Table;

use vars qw/ @Testat /;
@Testat= (-3,-3,-3,-3,-3,-3);

### ATTENTION  an array MUST be assigned something before it can be
###            used as a '-variable' in a (Radio/Check/) Button
###            NEVER use a list assign like  @Testat= (list)
###            since this reallocates @Testat

my $MW = new MainWindow;

my $Table= $MW->Table(-columns => 7, -rows => 4, -fixedrows => 1,
                                                -scrollbars => '')
              ->pack(-pady=> '2c');

# init Table

$Table->Create(1,0,'Label',-text => '  Testat OK ->  ');
$Table->Create(2,0,'Label',-text => '  No Testat ->  ');
$Table->Create(3,0,'Label',-text => '  - UNDEF - ->  ');

my $Mode;
my $Alab;

for (my $c= 1; $c <= 6; $c++)
{ $Mode = ( $Testat[$c-1] >= 0 ? 'disabled' : 'normal' );
  $Alab= ( $c < 6 ? "A$c" : "T" );
  $Table->Create(0,$c,'Label',-text => $Alab );
  $Table->Create(1,$c,'Radiobutton', -value => 1,  -state => $Mode,
                                     -variable => \$Testat[$c-1] );
  $Table->Create(2,$c,'Radiobutton', -value => 0,  -state => $Mode,
                                     -variable => \$Testat[$c-1] );
  $Table->Create(3,$c,'Radiobutton', -value => -3,  -state => $Mode,
                                     -variable => \$Testat[$c-1] );
}


MainLoop;