At work I code by the ton. At home I could for fun; experimenting with Tk and whatever other cool modules I might happen to stumble upon; to learn new things and tinker around with that which is cool (which would be just about anything PERL)

This time it is about as simple as it gets. Poking around the world of CPAN I found the module Tk::Clock. In a nutshell, this Tk module generates a digital clock face, analog clock face or both. I decided to assemble the script so that it generated a "BIG classic analog clock". The module allows for manipulation of the colors of the hands and tick marks. In addition, in this particular script, I have played around restricting resizing of the Tk GUI (I read about it in one of the major Perl Books). Anyway enough said. The code is posted below.

As always, any feedback is greatly appreciated! Enjoy!

Learning Is What Makes Life Interesting... And PerlMonks Is A Great Part Of Learning!


#!/usr/bin/perl -w use Tk; use Tk::Clock; my $MW=MainWindow->new(); ### --- Prevents Main Window Resizing $MW->bind('<Configure>' => sub{ my $xe = $MW->XEvent; $MW->maxsize($xe->w, $xe->h); $MW->minsize($xe->w, $xe->h); }); $MW->title("My Analog Clock"); $clock = $MW->Clock(); $clock->config( useDigital => 0, useAnalog => 1, anaScale => 880, handColor => 'Green4', secsColor => 'Red2', tickColor => 'Black', ); $clock->pack(); MainLoop();

In reply to Perl/Tk - Tk::Clock by PERLscienceman

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.