Doh!!! Story of my life .... a day late and a dollar short. I knew something wasn't right, it's that add 1 to $mon, but not to $mday gotch!! Arghh. It was last night. Anyways, this does show the difference in Perl/Tk and Perl/Gtk2 programming.

This is just a dumb and easy script, to help you easily partake in the great 1111111111 celebration this evening ( at around 8:58:30 Eastern Daylight Savings Time (by my calculations....I may be wrong :=0)). I wouldn't have thought of it, except for 1111111111 , followed by a post on the Gtk2-Perl maillist, about a Gtk2 countdown timer. So I figured Tk, may as well throw it's code into the celebration. I was going to add a warning beeper, 15 seconds before the fireworks, but I figure that would be too annoying. The Gtk2 code is also shown below for comparison.

#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = new MainWindow; $mw->fontCreate('big', -family=>'Arial', -weight=>'bold', -size=>int(-24*24/14)); my $ctime = time; my $lab = $mw->Label( -background => 'lightgreen', -font =>'big', -textvariable=> \$ctime)->pack(); $mw->repeat(500, sub{ $ctime = time }); MainLoop; __END__ #Gtk2 version by McLean of the gtk2-perl maillist ###################################################### #!/usr/bin/perl use strict; use Gtk2 -init; use Glib qw(TRUE FALSE); my $window = Gtk2::Window->new; $window->signal_connect(delete_event => sub { Gtk2->main_quit; }); my $label = Gtk2::Label->new('' . time()); my $font = Gtk2::Pango::FontDescription->from_string("Sans Bold 48"); $label->modify_font($font); Glib::Timeout->add(250, sub { $label->set_text('' . time()); TRUE; }); $window->add($label); $window->show_all; Gtk2->main; __END__

In reply to 1111111111-countdown-watcher by zentara

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.