35
37
when the widget is destroyed. An almost identical interface, but without
36
38
automatic cancel, and without repeat is provided via Tk::after method.
40
=head2 Internal Details
38
42
The internal Tk::After class has the following synopsis:
40
$id = Tk::After->new($widget,$time,'once',callback);
41
$id = Tk::After->new($widget,$time,'repeat',callback);
44
$id = Tk::After->new($widget, tid, $time, 'once', callback);
45
$id = Tk::After->new($widget, tid, $time, 'repeat', callback);
44
The B<after> method has several forms as follows:
49
$id is a Tk::After object, an array of 5 elements:
51
I<$widget> is the parent widget reference.
53
I<tid> is the internal timer id, a unique string.
55
I<$time> is the string 'idle', representing an idle queue timer, or a
56
integer millisecond value.
58
I<once> or I<repeat> specifies whether the timer is a one-time B<after>
59
event, or a repeating B<repeat> event.
61
I<callback> specifies a Perl/Tk Tk::Callback object.
63
=head1 Changing a B<repeat> timer interval
65
It's posible to change a B<repeat> timer's delay value, or even cancel
66
any timer, using the B<time> method. If I<delay> is specified and
67
non-zero, a new timer delay is established. If I<delay> is zero the
68
timer event is canceled just as if I<$id>-E<gt>B<cancel> were invoked.
69
In all cases the current millisecond timer delay is returned.
71
Note: the new timer delay will take effect on the I<subsequent> timer
72
event - this command will not cancel the pending timer event and
73
re-issue it with the new delay time.
75
=head1 The after() method has several forms as follows:
105
136
=item I<$widget>-E<gt>B<afterInfo>?(I<$id>)?
107
This command returns information about existing event handlers. If no I<$id>
108
argument is supplied, the command returns a list of the identifiers for all
109
existing event handlers created by the B<after> command for this MainWindow. If
110
I<$id> is supplied, it specifies an existing handler; I<$id> must have been the
111
return value from some previous call to B<after> and it must not have triggered
112
yet or been cancelled. In this case the command returns a list with two elements.
113
The first element of the list is the callback associated with I<$id>, and the
114
second element is either B<idle> or B<timer> to indicate what kind of event
138
This command returns information about existing event handlers. If no
139
I<$id> argument is supplied, the command returns a list of the
140
identifiers for all existing event handlers created by the B<after>
141
and B<repeat> commands for I<$widget>. If I<$id> is supplied, it
142
specifies an existing handler; I<$id> must have been the return value
143
from some previous call to B<after> or B<repeat> and it must not have
144
triggered yet or been cancelled. In this case the command returns a
145
list with three elements. The first element of the list is the
146
callback associated with I<$id>, the second element is either B<idle>
147
or the I<integer> timer millisecond value to indicate what kind of
148
event handler it is, and the third is a string I<once> or I<repeat> to
149
differentiate an B<after> from a B<repeat> event.