ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/digital-clock
(Generate patch)

Comparing rxvt-unicode/src/perl/digital-clock (file contents):
Revision 1.7 by root, Tue Jan 3 20:47:36 2006 UTC vs.
Revision 1.9 by root, Mon Jan 23 23:13:03 2006 UTC

1#! perl 1#! perl
2 2
3# this creates a simple digital clock 3# this creates a simple digital clock
4 4
5sub on_init { 5sub on_start {
6 my ($self) = @_; 6 my ($self) = @_;
7 7
8 $self->{overlay} = $self->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0); 8 $self->{overlay} = $self->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0);
9 $self->{timer} = urxvt::timer 9 $self->{timer} = urxvt::timer
10 ->new 10 ->new
11 ->start (int urxvt::NOW) # make sure we update "on" the second 11 ->start (1 + int urxvt::NOW) # make sure we update "on" the second
12 ->interval (1) 12 ->interval (1)
13 ->cb (sub { 13 ->cb (sub {
14 $self->{overlay}->set (0, 0, 14 $self->{overlay}->set (0, 0,
15 sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]); 15 sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]);
16 }); 16 });

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines