Here is mine Tk::Zinc version, with a little help from Advantages of Tk::Zinc over plain Canvas, Tk::Clock, -tk Moving circle, it works, but rotate is busted :)
#!/usr/bin/perl -- use warnings; use strict; use Tk; use Tk::Zinc ; use Tk::Clock; my $mw = tkinit; my $canvas = $mw->Zinc( -width => 300, -height => 300, -backcolor => 'white', )->pack(qw/ -expand 1 -fill both -padx 10 -pady 10 /); my $clock = $mw->Clock( useAnalog => 1, )->pack; my $circle_radius = 100; my $origin_x = $canvas->cget('-height') / 2 ; my $origin_y = $canvas->cget('-width') / 2; my $cgroup = $canvas->add('group',1,-visible=> 1); #~ my $circle = $canvas->createOval( my $innercircle = $canvas->add( 'arc', $cgroup, [ $origin_x - ( $circle_radius - 10 ), $origin_y - ( $circle_radius - 10 ), $origin_x + ( $circle_radius - 10 ), $origin_y + ( $circle_radius - 10 ), ], ); my $circle = $canvas->add( 'arc', $cgroup, [ $origin_x - $circle_radius, $origin_y - $circle_radius, $origin_x + $circle_radius, $origin_y + $circle_radius, ], ); my $ix=0; my $PI=3.141592635; my $angle = -30; for my $dtick ( 1 .. 12 ){ my $d8 = 9; $angle += 30; my $cos = cos($angle*$PI/180); my $sin = sin($angle*$PI/180); my $x1 = $origin_x + ( ( $circle_radius - $d8 ) * $sin ); my $y1 = $origin_y - ( ( $circle_radius - $d8 ) * $cos ); my $x2 = $origin_x + ( ( $circle_radius + $d8 ) * $sin ); my $y2 = $origin_y - ( ( $circle_radius + $d8 ) * $cos ); #~ my $line = $canvas->createLine ( my $line = $canvas->add( 'curve', $cgroup, [ $x1, $y1, $x2, $y2, ], -tags => "tick", -linecolor => 'red', -filled => 1, -linewidth => 1.0, ); my $text = $canvas->add( 'text', $cgroup, -position => [ $x1,$y1 ], -text => ixHour( $ix++) , -color => 'blue', ); # no work, disappeared or crash #~ $canvas->rotate( $text, $angle , 'degree' ); } MainLoop; sub ixHour { return [qw/ one two three four five six seven eight nine ten eleven twelve /]->[ -1 + shift ] } __END__

In reply to Re^2: algorithm help -- how to label a clock by Anonymous Monk
in thread algorithm help -- how to label a clock by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.