ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/urxvt.pm
(Generate patch)

Comparing rxvt-unicode/src/urxvt.pm (file contents):
Revision 1.178 by root, Sat Dec 26 09:02:42 2009 UTC vs.
Revision 1.179 by root, Sat Dec 26 09:23:53 2009 UTC

1136 1136
1137 my $cb = $arg{cb}; 1137 my $cb = $arg{cb};
1138 1138
1139 urxvt::timer 1139 urxvt::timer
1140 ->new 1140 ->new
1141 ->after ($arg{after}) 1141 ->after ($arg{after}, $arg{interval})
1142 ->interval ($arg{interval})
1143 ->start
1144 ->cb ($argv{interval} ? $cb : sub { 1142 ->cb ($arg{interval} ? $cb : sub {
1145 $_[0]->stop; # need to cancel manually 1143 $_[0]->stop; # need to cancel manually
1146 $cb->(); 1144 $cb->();
1147 }) 1145 })
1148} 1146}
1149 1147
2055 2053
2056=item $timer = $timer->cb (sub { my ($timer) = @_; ... }) 2054=item $timer = $timer->cb (sub { my ($timer) = @_; ... })
2057 2055
2058Set the callback to be called when the timer triggers. 2056Set the callback to be called when the timer triggers.
2059 2057
2060=item $tstamp = $timer->at
2061
2062Return the time this watcher will fire next.
2063
2064=item $timer = $timer->set ($tstamp) 2058=item $timer = $timer->set ($tstamp[, $interval])
2065 2059
2066Set the time the event is generated to $tstamp. 2060Set the time the event is generated to $tstamp (and optionally specifies a
2061new $interval).
2067 2062
2068=item $timer = $timer->interval ($interval) 2063=item $timer = $timer->interval ($interval)
2069 2064
2070Normally (and when C<$interval> is C<0>), the timer will automatically 2065By default (and when C<$interval> is C<0>), the timer will automatically
2071stop after it has fired once. If C<$interval> is non-zero, then the timer 2066stop after it has fired once. If C<$interval> is non-zero, then the timer
2072is automatically rescheduled at the given intervals. 2067is automatically rescheduled at the given intervals.
2073 2068
2074=item $timer = $timer->start 2069=item $timer = $timer->start
2075 2070
2076Start the timer. 2071Start the timer.
2077 2072
2078=item $timer = $timer->start ($tstamp) 2073=item $timer = $timer->start ($tstamp[, $interval])
2079 2074
2080Set the event trigger time to C<$tstamp> and start the timer. 2075Set the event trigger time to C<$tstamp> and start the timer. Optionally
2076also replaces the interval.
2081 2077
2082=item $timer = $timer->after ($delay) 2078=item $timer = $timer->after ($delay[, $interval])
2083 2079
2084Like C<start>, but sets the expiry timer to c<urxvt::NOW + $delay>. 2080Like C<start>, but sets the expiry timer to c<urxvt::NOW + $delay>.
2085 2081
2086=item $timer = $timer->stop 2082=item $timer = $timer->stop
2087 2083

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines