aboutsummaryrefslogtreecommitdiff
path: root/sandbox/alllineshapes.pl
blob: 89bc6bb93c2604488270ca63898e6e4fdd555ee7 (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
#!/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 = '-b&h-lucida-bold-r-normal-*-*-140-*-*-p-*-iso10646-1';
my $mw = MainWindow->new();
my $zinc = $mw->Zinc(-width => 800, -height => 500,
#		     -render => 1,
#		     -backcolor => "red", # this will be transparent in the doc
		     )->pack();


my $i = 1;
my $x = 20;
my $y = 100;
foreach my $lineshape ( qw(straight rightlightning leftlightning rightcorner
			    leftcorner doublerightcorner doubleleftcorner) ) {
    print "$lineshape\n";
    my $wpt = $zinc->add('waypoint', 1, 1,
			 -position => [$x, $y],
			 -labelformat => "a5a5+0+0",
			 -leadershape => $lineshape,
			 -labeldistance => 150,
			 );
    $zinc->itemconfigure($wpt, 0,
			 -text => $lineshape,
			 -alignment => "center",
			 );
    $i++;
    if ($i == 4) {
	$x = 20;
	$y = $y + 150;
	$i = 1;
    }
    else {
	$x = $x + 180;
    }
}



MainLoop();