$self->{overlay} = $self->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0);
$self->{timer} = urxvt::timer
->new
- ->start (int urxvt::NOW) # make sure we update "on" the second
+ ->start (1 + int urxvt::NOW) # make sure we update "on" the second
->interval (1)
->cb (sub {
$self->{overlay}->set (0, 0,
# force a refresh every second
$self->{digital_clock_refresh} = urxvt::timer
->new
- ->start (urxvt::NOW)
- ->cb (sub {
- $self->{digital_clock_refresh}->start ($self->{digital_clock_refresh}->at + 1);
- $self->want_refresh;
- });
+ ->start (1 + int urxvt::NOW)
+ ->interval (1)
+ ->cb (sub { $self->want_refresh });
()
}
my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1);
$overlay->set (0, 0, $msg);
- my $iow; $iow = urxvt::timer->new->start (urxvt::NOW + 2)->cb (sub {
+ my $iow; $iow = urxvt::timer->new->after (2)->cb (sub {
undef $overlay;
undef $iow;
});
my $timer; $timer =
urxvt::timer
->new
- ->start (urxvt::NOW + 5)
+ ->after (5)
->cb (sub {undef $timer; undef $ov; });
}
my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1);
$overlay->set (0, 0, $msg);
- my $iow; $iow = urxvt::timer->new->start (urxvt::NOW + 1)->cb (sub {
+ my $iow; $iow = urxvt::timer->new->after (1)->cb (sub {
undef $overlay;
undef $iow;
});
$_->{width} = $self->strwidth ($_->{text})
for @{ $data->{item} };
+ $self->resource (title => "URxvt Popup Menu");
+ $self->resource (name => "URxvt.popup");
+
$self->resource ($_ => $data->{term}->resource ($_))
for qw(font boldFont italicFont boldItalicFont color+0 color+1);
OUTPUT:
RETVAL
+timer *
+timer::after (NV delay)
+ CODE:
+ THIS->start (NOW + delay);
+ OUTPUT:
+ RETVAL
+
timer *
timer::stop ()
CODE:
{
// basically this is a slightly optimized scr_blank_screen_mem
// it is worth the effort on slower machines
- line_t &l = ROW(row2 - i);
+ line_t &l = ROW(nrow - 1 - i);
scr_blank_line (l, 0, l.l, rstyle);
delete $env->{LC_ALL};
$env->{LC_CTYPE} = $self->{term}->locale;
- urxvt::term->new ($env, $self->{term}->resource ("name"),
+ urxvt::term->new ($env, "popup",
"--perl-lib" => "", "--perl-ext-common" => "", "-pty-fd" => -1, "-sl" => 0, "-b" => 0,
"--transient-for" => $self->{term}->parent,
"-display" => $self->{term}->display_id,
Set the event trigger time to C<$tstamp> and start the timer.
+=item $timer = $timer->after ($delay)
+
+Like C<start>, but sets the expiry timer to c<urxvt::NOW + $delay>.
+
=item $timer = $timer->stop
Stop the timer.