Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: 1111111111-countdown-watcher

by chanio (Priest)
on Mar 22, 2005 at 04:18 UTC ( [id://441383]=note: print w/replies, xml ) Need Help??


in reply to 1111111111-countdown-watcher

Thanks, I added some lines to have an extravagant clock...

use strict; local $| = 1; use Tk; use POSIX qw(strftime setlocale LC_ALL LC_CTYPE); my ($whatsUrLocale)= 'es_AR.ISO8859-1'; my ($dateFormat) = "%A, %d %b %H:%M:%S %Y"; my ($clockTitle) = 'TEMPUS FUGIT'; my ($loc) = POSIX::setlocale( &POSIX::LC_ALL, $whatsUrLocale ); ## Just in case... $ENV{LANG} = $whatsUrLocale; my $mw = new MainWindow; $mw->title($clockTitle); $mw->fontCreate('mini', -family=>'Arial', # -weight=>'bold', -size=>int(-11*11/6)); $mw->fontCreate('big', -family=>'Arial', -weight=>'bold', -size=>int(-24*24/14)); my $ctime = ' '. time ; my $horeja= strftime $dateFormat, localtime; my $hor = $mw->Label( -background => 'lightblue', -foreground => 'darkblue', -font =>'mini', -textvariable=> \$horeja )->pack(); my $lab = $mw->Label( -background => 'lightgreen', -foreground => 'orange', -font =>'big', -textvariable=> \$ctime)->pack(); $mw->repeat(500, sub{ $ctime = ' '. time; $horeja= strftime $dateForma +t, localtime; }); MainLoop; __END__

UPDATED: Sorry, I was meaning the DOW "%A" instead of the month "%a". Thanks zentara

.{\('v')/}   C H E E R   U P !
 _`(___)' ___a_l_b_e_r_t_o_________
Wherever I lay my KNOPPIX disk, a new FREE LINUX nation could be established.

Replies are listed 'Best First'.
Re^2: 1111111111-countdown-watcher
by zentara (Archbishop) on Mar 22, 2005 at 13:44 UTC
    As a minor nitpick, I get the month repeated twice, in your

    my ($dateFormat) = "%a, %d %b %H:%M:%S %Y";

    I remove either the %a or the %b, to suit my tastes. But maybe you have a reason for doing it that way?


    I'm not really a human, but I play one on earth. flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://441383]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-24 18:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found