… | |
… | |
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 | |
… | |
… | |
1374 | |
1372 | |
1375 | =item ($row, $col) = $term->selection_beg ([$row, $col]) |
1373 | =item ($row, $col) = $term->selection_beg ([$row, $col]) |
1376 | |
1374 | |
1377 | =item ($row, $col) = $term->selection_end ([$row, $col]) |
1375 | =item ($row, $col) = $term->selection_end ([$row, $col]) |
1378 | |
1376 | |
1379 | Return the current values of the selection mark, begin or end positions, |
1377 | Return the current values of the selection mark, begin or end positions. |
1380 | and optionally set them to new values. |
1378 | |
|
|
1379 | When arguments are given, then the selection coordinates are set to |
|
|
1380 | C<$row> and C<$col>, and the selection screen is set to the current |
|
|
1381 | screen. |
|
|
1382 | |
|
|
1383 | =item $screen = $term->selection_screen ([$screen]) |
|
|
1384 | |
|
|
1385 | Returns the current selection screen, and then optionally sets it. |
1381 | |
1386 | |
1382 | =item $term->selection_make ($eventtime[, $rectangular]) |
1387 | =item $term->selection_make ($eventtime[, $rectangular]) |
1383 | |
1388 | |
1384 | Tries to make a selection as set by C<selection_beg> and |
1389 | Tries to make a selection as set by C<selection_beg> and |
1385 | C<selection_end>. If C<$rectangular> is true (default: false), a |
1390 | C<selection_end>. If C<$rectangular> is true (default: false), a |
… | |
… | |
2055 | |
2060 | |
2056 | =item $timer = $timer->cb (sub { my ($timer) = @_; ... }) |
2061 | =item $timer = $timer->cb (sub { my ($timer) = @_; ... }) |
2057 | |
2062 | |
2058 | Set the callback to be called when the timer triggers. |
2063 | Set the callback to be called when the timer triggers. |
2059 | |
2064 | |
2060 | =item $tstamp = $timer->at |
|
|
2061 | |
|
|
2062 | Return the time this watcher will fire next. |
|
|
2063 | |
|
|
2064 | =item $timer = $timer->set ($tstamp) |
2065 | =item $timer = $timer->set ($tstamp[, $interval]) |
2065 | |
2066 | |
2066 | Set the time the event is generated to $tstamp. |
2067 | Set the time the event is generated to $tstamp (and optionally specifies a |
|
|
2068 | new $interval). |
2067 | |
2069 | |
2068 | =item $timer = $timer->interval ($interval) |
2070 | =item $timer = $timer->interval ($interval) |
2069 | |
2071 | |
2070 | Normally (and when C<$interval> is C<0>), the timer will automatically |
2072 | By default (and when C<$interval> is C<0>), the timer will automatically |
2071 | stop after it has fired once. If C<$interval> is non-zero, then the timer |
2073 | stop after it has fired once. If C<$interval> is non-zero, then the timer |
2072 | is automatically rescheduled at the given intervals. |
2074 | is automatically rescheduled at the given intervals. |
2073 | |
2075 | |
2074 | =item $timer = $timer->start |
2076 | =item $timer = $timer->start |
2075 | |
2077 | |
2076 | Start the timer. |
2078 | Start the timer. |
2077 | |
2079 | |
2078 | =item $timer = $timer->start ($tstamp) |
2080 | =item $timer = $timer->start ($tstamp[, $interval]) |
2079 | |
2081 | |
2080 | Set the event trigger time to C<$tstamp> and start the timer. |
2082 | Set the event trigger time to C<$tstamp> and start the timer. Optionally |
|
|
2083 | also replaces the interval. |
2081 | |
2084 | |
2082 | =item $timer = $timer->after ($delay) |
2085 | =item $timer = $timer->after ($delay[, $interval]) |
2083 | |
2086 | |
2084 | Like C<start>, but sets the expiry timer to c<urxvt::NOW + $delay>. |
2087 | Like C<start>, but sets the expiry timer to c<urxvt::NOW + $delay>. |
2085 | |
2088 | |
2086 | =item $timer = $timer->stop |
2089 | =item $timer = $timer->stop |
2087 | |
2090 | |