NAME
Tk::Clock - Clock widget with analog and digital display
SYNOPSIS
use Tk use Tk::Clock;
$clock = $parent->Clock (?-option => <value> ...?);
$clock->config ( # These reflect the defaults useAnalog => 1, useDigital => 1, handColor => "Green4", secsColor => "Green2", tickColor => "Yellow4", timeFont => "fixed", timeColor => "Red4", timeFormat => "HH.MM:SS", dateFont => "fixed", dateColor => "Blue4", dateFormat => "dd-mm-yy");
DESCRIPTION
Create a clock canvas with both an analog- and a digital display. Either can be disabled by setting useAnalog or useDigital to 0 resp.
Legal dateFormat characters are d and dd for date, ddd and dddd for weekday, m, mm, mmm and mmmm for month, y and yy for year and any separators :, -, / or space.
Legal timeFormat characters are H and HH for hour, h and hh for AM/PM hour, M and MM for minutes, S and SS for seconds, A for AM/PM indicator and any separators :, -, . or space.
BUGS
If the system load's too high, the clock might skip some seconds.
Due to the fact that the year is expressed in 2 digit's, this widget is not Y2K compliant in the default configuration.
There's no check if either format will fit in the given space.
TODO
* Scalability would be a nice feature. * Using POSIX' strftime () for dateFormat. Current implementation would probably make this very slow.
AUTHOR
H.Merijn Brand <merijn@hempseed.com>
Thanks to Larry Wall for inventing perl. Thanks to Nick Ing-Simmons for providing perlTk. Thanks to Achim Bohnet for introducing me to OO (and converting the basics of my clock.pl to clock.pm). Thanks to Sriram Srinivasan for understanding OO though his Panther book.