Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
*error message I get: Global symbol "@cloned_balls" requires explicit package name... # Am on Windows XP Home # With ActiveState ActivePerl 5.8.7 Build 815 # Also use EnginSite Perl Editor LITEsub balls { if ($gismo =~ /0/) { # var for no balls showing ## balls #create a group with it's origin at 60 across, and 600 down my $centergroup2= $zinc->add('group',1,-visible=> 1); $zinc->translate($centergroup2,60,600); my $outerring2 = $zinc->add('group',$centergroup2,-visible =>1); # + for out balls my $outerring2a = $zinc->add('group',$centergroup2,-visible =>1); + # for inner ball my @basiccolors = (['Jaune','#fff52a','#f1f1f1','#6a6611'], ["Jaune\nOrangé",'#ffc017','#cfcfcf','#6b510a'], ['Orangé','#ff7500','#a5a5a5','#622d00'], ['Rouge','#ff2501','#8b8b8b','#620e00'], ['Magenta','#ec145d','#828282','#600826'], ["Violet\nRouge",'#a41496','#636363','#020940'], ["Violet\nBleu",'#6a25b6','#555555','#2a0f48'], ['Bleu','#324bde','#646464','#101846'], ['Cyan','#0a74f0','#818181','#064a9a'], ["Bleu\nVert",'#009bb4','#969696','#006474'], ['Vert','#0fa706','#979797','#096604'], ["Jaune\nVert",'#9dd625','#c9c9c9','#496311'], ["new1",'lightgray','#c0c0c0','#496311'], ); my $i; my ($colorname, $saturcolor, $greycolor, $shadcolor) = @{$basiccolors[ +12]}; # 0 to 12 to switch between the above my $refgrad = "=radial -12 -20|#ffffff 0|".$saturcolor." 40|".$shadcol +or." 100"; # inner ball my $inerbal = $zinc->add('arc',$outerring2a, [ [-5,12], [5,22] ], -filled => 1, -fillcolor => $gradset{'roundpolyg2'}, +# -linewidth => 0, -priority => 100, -visible=> 1, ); $zinc->bind($inerbal, '<1>', \&ro2b); # want to + drag it within the circle $zinc->bind($inerbal, '<3>', \&start); # outer marker balls my $refitem = $zinc->add('arc',$outerring2, [ [10,20], [20,30] ], -filled => 1, -fillcolor => $refgrad, ## -linewidth => 0, -priority => 100, -visible => 1, ); my @cloned_balls; # array ref for the ball's names to be but into ? +??? for (1..11){ my $relement = $zinc->clone($refitem); $zinc->rotate($relement,.53*$_); # Then to put the balls in the array. push(@cloned_balls, $relement); } # want all balls to be markers for positions of the main wind +ow $zinc->bind($cloned_balls[7], '<1>', \&ro1); $zinc->bind($cloned_balls[8], '<1>', \&ro2); # $zinc->bind($cloned_balls[9], '<1>', \&ro3); # three o'clock pos +ition $zinc->bind($cloned_balls[10], '<1>', \&ro4); $zinc->bind($refitem, '<1>', \&ro5); $zinc->bind($cloned_balls[0], '<1>', \&ro6); # six o'clock $zinc->bind($cloned_balls[1], '<1>', \&ro7); $zinc->bind($cloned_balls[2], '<1>', \&ro8); $zinc->bind($cloned_balls[3], '<1>', \&ro9); # nine o'clock $zinc->bind($cloned_balls[4], '<1>', \&ro10); $zinc->bind($cloned_balls[5], '<1>', \&ro11); $zinc->bind($cloned_balls[6], '<1>', \&ro12); $gismo = 1; } #else if ($gismo =~ /1/) { # this means the balls are displa +yed, so I want to remove/hide them here... print "\$gismo = $gismo.\n" ; # test this part is run on second click +of text # working # # # ################################### So why doesn't the below work ?? +?? ############################# # #my @cloned_balls; $zinc->itemconfigure($cloned_balls[0], -visible => 0,); # I don't und +erstand why it's not work* #$mw->update; #$zinc->update; #$gismo = 0; # means no balls being displayed, so run the show balls p +art when text is clicked again } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: -visible => 0,
by aquarium (Curate) on Apr 15, 2006 at 13:06 UTC | |
by Anonymous Monk on Apr 15, 2006 at 16:42 UTC | |
|
Re: -visible => 0,
by zentara (Cardinal) on Apr 15, 2006 at 16:56 UTC | |
by Anonymous Monk on Apr 16, 2006 at 10:34 UTC |