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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
#!/usr/bin/perl
# $Id$
# these simple samples have been developped by C. Mertz mertz@cena.fr
use Tk;
use Tk::Zinc;
use strict;
my $defaultfont = '-adobe-helvetica-bold-r-normal-*-120-*-*-*-*-*-*';
my $mw = MainWindow->new();
my $zinc = $mw->Zinc(-width => 700, -height => 600,
-borderwidth => 3, -relief => 'sunken',
-render => 1, # for activating the openGL render
)->pack;
die "no openGL rendering on this X server" unless $zinc->cget(-render);
$zinc->add('rectangle', 1, [10, 10, 690, 100], -fillcolor => "red|blue/90", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
-text => "A variation from non transparent red to non transparent blue.\n",
-anchor => 'nw',
-position => [20, 20]);
$zinc->add('rectangle', 1, [10,110, 690, 200], -fillcolor => "red:40|blue:40/90", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
-text => "A variation from 40%transparent red to 40% transparent blue.",
-anchor => 'nw',
-position => [20, 120]);
$zinc->add('rectangle', 1, [10, 210, 690, 300], -fillcolor => "red:40|green:40 50|blue:40/90", -filled => 1);
$zinc->add('text', 1,
-font => $defaultfont,
-text => "A variation from 40%transparent red to 40% transparent blue.\n".
"through a 40%green on the middle",
-anchor => 'nw',
-position => [20, 220]);
$zinc->add('text', 1,
-font => $defaultfont,
-text => "Two overlaping transparently colored rectangles on a white background",
-anchor => 'nw',
-position => [20, 320]);
$zinc->add('rectangle', 1, [10, 340, 690, 590], -fillcolor => "white", -filled => 1);
$zinc->add('rectangle', 1, [200, 350, 500, 580], -fillcolor => "red:40|green:40 50|blue:40/90", -filled => 1);
$zinc->add('rectangle', 1, [10, 400, 690, 500], -fillcolor => "yellow:40|black:40 50|cyan:40/90", -filled => 1);
MainLoop;
|