aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Perl/t/zinc.t29
1 files changed, 15 insertions, 14 deletions
diff --git a/Perl/t/zinc.t b/Perl/t/zinc.t
index bbd3a8b..26c3902 100644
--- a/Perl/t/zinc.t
+++ b/Perl/t/zinc.t
@@ -20,6 +20,7 @@ $logo = $mw->Photo(-file => "/home/etienne/images/logo.gif");
#$mw->Radar()->pack;
#MainLoop; exit;
+$top = 1;
$radar = $mw->Radar(-backcolor => 'skyblue', -relief => 'sunken');
$radar->pack(-expand => t, -fill => 'both');
@@ -29,7 +30,7 @@ $color = $radar->cget("-backcolor"); print "radar backcolor=$color\n";
###################################################
# creation track
###################################################
-$track = $radar->add("track", 10);
+$track = $radar->add("track", $top, 10);
#$radar->itemconfigure($track, -tags => 'toto');
$radar->itemconfigure($track, -position => [1, 1]);
@@ -81,7 +82,7 @@ $radar->bind($track.":-3", "<Leave>",
# creation way point
###################################################
print "creating way point\n";
-my $wp = $radar->add("waypoint", 10);
+my $wp = $radar->add("waypoint", $top, 10);
$radar->itemconfigure($wp,
-symbolcolor => "green",
-position => [0, 80],
@@ -97,14 +98,14 @@ $radar->bind($wp, "<Leave>", [ \&borders, "off"]);
# creation 2nd track
###################################################
print "creating second track\n";
-$track2 = $radar->add("track", 10, -speedvector => [-20, 0], -position => [0, 50]);
+$track2 = $radar->add("track", $top, 10, -speedvector => [-20, 0], -position => [0, 50]);
$radar->itemconfigure($track2, -connecteditem => $track);
###################################################
# creation macro
###################################################
print "creating macro\n";
-$macro = $radar->add("macro", 10,
+$macro = $radar->add("macro", $top, 10,
-labelformat => "80x40|40+20|40+20|40+20,0:40x20+0+0,1:40x20+40+0"
);
$radar->itemconfigure($macro, 0 , -text => "une");
@@ -117,7 +118,7 @@ $radar->bind($macro.":0", "<Leave>", [ \&borders, "off"]);
# creation ministrip
###################################################
print "creating ministrip\n";
-$ministrip = $radar->add("ministrip", 10,
+$ministrip = $radar->add("ministrip", $top, 10,
-labelformat => "80x40|40+20|40+20|40+20,0:40x20+0+0,1:40x20+40+0",
-position => [100, 10]
);
@@ -133,14 +134,14 @@ $mw->videomap("load", "/home/etienne/tmp/hegias_parouest_TE.vid", 0, "paris-oues
print "videomap ids : ",
join('|', $mw->videomap("ids", "/home/etienne/tmp/videomap_orly")),"\n";
-$map = $radar->add("map", -color => red);
+$map = $radar->add("map", $top, -color => red);
$radar->itemconfigure($map,-mapinfo => orly);
-$map2 = $radar->add("map", -color => green, -filled => 1, -priority => 0,
+$map2 = $radar->add("map", $top, -color => green, -filled => 1, -priority => 0,
-fillpattern => AlphaStipple6);
#$radar->itemconfigure($map2, -mapinfo => paris-ouest);
-$map3 = $radar->add("map", -color => orange);
+$map3 = $radar->add("map", $top, -color => orange);
$radar->itemconfigure($map3,-mapinfo => "paris-w");
@@ -148,15 +149,15 @@ $radar->itemconfigure($map3,-mapinfo => "paris-w");
#creation rectangle, arc, multipoint
###################################################
-$rect = $radar->add(rectangle, -50, -50, 50, -80, -linecolor => bisque);
+$rect = $radar->add(rectangle, $top, -50, -50, 50, -80, -linecolor => bisque);
$radar->bind($rect, '<Enter>', sub { $radar->itemconfigure($rect, -linecolor => red)});
$radar->bind($rect, '<Leave>', sub { $radar->itemconfigure($rect, -linecolor => bisque)});
-$arc = $radar->add(arc, -100, 80, -50, 30, -linecolor => bisque,
+$arc = $radar->add(arc, $top, -100, 80, -50, 30, -linecolor => bisque,
-tags => ["arc"]);
#$radar->addtag("fleche",'withtag', $arc);
#$radar->addtag("carquois",'withtag', $arc);
-$radar->add(rectangle, -101, 81, -49, 29, -linecolor => green);
+$radar->add(rectangle, $top, -101, 81, -49, 29, -linecolor => green);
$radar->raise($arc);
$radar->bind($arc, '<Enter>', sub {$radar->itemconfigure($arc, -linecolor => red)});
$radar->bind($arc, '<Leave>', sub {$radar->itemconfigure($arc, -linecolor => bisque)});
@@ -164,7 +165,7 @@ print "arc tags=", join('|',$radar->gettags($arc)),"\n";
$radar->itemconfigure($arc, -startangle => 0, -extent => 360);
-$mp = $radar->add(multipoint, -300, 0, -250, 100, -80, 20);
+$mp = $radar->add(multipoint, $top, -300, 0, -250, 100, -80, 20);
$radar->itemconfigure($mp, -filled => 1, -linewidth => 4, -linecolor => yellow,
-fillcolor => tan, -fillpattern => AlphaStipple8);
$radar->itemconfigure($mp, -marker => AtcSymbol9 , -markercolor => red);
@@ -199,8 +200,8 @@ $radar->Tk::bind('<ButtonPress-1>',
$radar->Tk::bind('<ButtonRelease-1>',
[ sub {&finditems($_[1], $_[2]); }, Ev('x'), Ev('y') ]);
-$radar->Tk::bind("<2>", sub {$radar->translate('all', 10,10); });
-$radar->Tk::bind("<3>", sub {$radar->scale(1.1, 1.1); });
+$radar->Tk::bind("<2>", sub {$radar->translate($top, 10,10); });
+$radar->Tk::bind("<3>", sub {$radar->scale($top, 1.1, 1.1); });
MainLoop;