aboutsummaryrefslogtreecommitdiff
path: root/sandbox/local.pl
blob: f4484203e51467b9195c951d040edbe7c8cf2717 (plain)
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
#!/usr/bin/perl -w

use Tk;
use Tk::Zinc;

$mw = MainWindow->new();
$logo = $mw->Photo(-file => "logo.gif");
$papier = $mw->Photo(-file => "texture-paper.xpm");
#$penguin = $mw->Photo(-file => "xpenguin.png");

$top = 1;
$zinc = $mw->Zinc(-Render, -relief => 'sunken');
$zinc->pack(-expand => 1, -fill => 'both');
$zinc->configure(-width => 500, -height => 500);
$gr1 = $zinc->add('group', $top);
$clip = $zinc->add('rectangle', $gr1, [50, 50, 399, 399],
		   -filled => 1, -fillcolor => 'pink', -linewidth => 0);
$zinc->itemconfigure($gr1, -clip => $clip);
$gr2 = $zinc->add('group', $gr1);
$clip2 = $zinc->add('rectangle', $gr2, [200, 200, 450, 450],
		    -filled => 1, -fillcolor => 'lavender', -linewidth => 0);
#$zinc->itemconfigure($gr2, -clip => $clip2);
$view = $zinc->add('group', $gr2, -tags => "controls");
$zinc->lower($clip);
$zinc->lower($clip2);

$rect = $zinc->add('rectangle', $view, [100, 100, 200, 200],
		   -linewidth => 4, -tile => $papier,
		   -fillcolor => 'pink', -fillalpha => 128,
		   -filled => 1);
$fvwm = $zinc->add('icon', $view,
		   -mask => '@fvwm.xbm', -position => [250, 120],
		   -anchor => 'center', -color => 'black',
		   -alpha => 255);
$rect2 = $zinc->add('rectangle', $view, [150, 50, 300, 300],
		    -linewidth => 0, -tile => $logo,
		    -fillcolor => 'white', -fillalpha => 90,
		    -filled => 1);
$x = 100;
$y = 100;
for ($i = 0; $i < 1; $i++) {
    $x = $x+3;
    $y = $y+3;
    $zinc->add('text', $view,
	       -text => "BlaBla et tout et tout, bref...",
	       -position => [$x, $y], -anchor => 'nw',
	       -color => 'red', -alpha => 90);
}
#$peng = $zinc->add('icon', $view,
#		   -image => $penguin, -position => [300, 300],
#		   -anchor => 'center', -alpha => 128);
$zinc->translate($rect, -150, -150);
$zinc->rotate($rect, 35);
$zinc->translate($rect, 150, 150);

#source controls.tcl
#
MainLoop();