From e41e8023e3d96bac3592d7ee676117e2d5b1d6a9 Mon Sep 17 00:00:00 2001 From: lecoanet Date: Thu, 11 Apr 2002 09:41:21 +0000 Subject: *** empty log message *** --- sandbox/testzinc.pl | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'sandbox') diff --git a/sandbox/testzinc.pl b/sandbox/testzinc.pl index 2b755fd..396a2be 100644 --- a/sandbox/testzinc.pl +++ b/sandbox/testzinc.pl @@ -3,12 +3,15 @@ use Tk; use Tk::Zinc; - +use Tk::Photo; +#use Tk::ZincText; +use ZincText; use Controls; $map_path = "/usr/share/toccata/maps"; $mw = MainWindow->new(); +$logo = $mw->Photo(-file => "logo.gif"); ################################################### @@ -24,13 +27,18 @@ $delay = 2000; $rate = 0.3; %tracks = (); -$zinc = $mw->Zinc(-render => 0, -backcolor => 'gray65', -relief => 'sunken'); +$zinc = $mw->Zinc(-render => 2, -backcolor => 'gray65', -relief => 'sunken'); $zinc->pack(-expand => 1, -fill => 'both'); $zinc->configure(-width => $zinc_width, -height => $zinc_height); #$radar = $top; $radar = $zinc->add('group', $top, -tags => ['controls', 'radar']); $zinc->configure(-overlapmanager => $radar); +new ZincText($zinc); +################################################### +# Création fonctions de contrôle à la souris +################################################### +new Controls($zinc); ################################################### # creation panneau controle @@ -139,7 +147,7 @@ sub create_tracks { -historycolor => 'gray30', -filledhistory => 0, -circlehistory => 1, - -labelformat => "x71x50+0+0 x50a0^0^0 x25a0^0>1 a0a0>2>1 x25a0>3>1 a0a0^0>2" + -labelformat => "x71x50+0+0 a0a0^0^0 a0a0^0>1 a0a0>2>1 a0a0>3>1 a0a0^0>2" ); $zinc->itemconfigure($item, 0, -filled => 0, @@ -356,12 +364,13 @@ sub stick_wp { -position => [$x, $y], -connectioncolor => 'red', -symbolcolor => 'red', - -labelformat => 'a2a2+0+0'); + -labelformat => 'a2a2+0+0', + -tags => ['text']); $zinc->itemconfigure($wp, 0, -text => "$x".'@'."$y", -color => 'red', -filled => 1, - -backcolor => 'gray55'); + -backcolor => 'gray55'); $zinc->bind($wp.':position', '<1>', [\&wipe_wp]); } @@ -371,7 +380,7 @@ sub wipe_wp { $just_wiped = 1; } -$zinc->Tk::bind('<1>', [\&stick_wp]); +$zinc->Tk::bind('<2>', [\&stick_wp]); ################################################### @@ -449,10 +458,6 @@ $zinc->itemconfigure($map3, #print join(' ', $zinc->coords($c, 0)), "\n"; #print join(' ', $zinc->coords($c, 1)), "\n"; -################################################### -# Création fonctions de contrôle à la souris -################################################### -new Controls($zinc); ################################################### # Rafraichissement des pistes -- cgit v1.1