~ubuntu-branches/ubuntu/natty/perl-tk/natty

« back to all changes in this revision

Viewing changes to pod/after.pod

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Zander
  • Date: 2004-03-14 13:54:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040314135444-prc09u2or4dbr3to
Tags: 1:800.025-2
Add xlibs-dev to Build-Depends:,
Closes: #237942

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
S<  >I<$widget>-E<gt>B<afterInfo>?(I<$id>)?
27
27
 
 
28
S<  >I<$id>-E<gt>B<time>(?I<delay>?)
 
29
 
28
30
=head1 DESCRIPTION
29
31
 
30
32
This method is used to delay execution of the program or to execute
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.
37
39
 
 
40
=head2 Internal Details
 
41
 
38
42
The internal Tk::After class has the following synopsis:
39
43
 
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);
42
46
  $id->cancel;
43
 
 
44
 
The B<after> method has several forms as follows:
 
47
  $id->time(?delay?);
 
48
 
 
49
$id is a Tk::After object, an array of 5 elements:      
 
50
 
 
51
I<$widget> is the parent widget reference.
 
52
 
 
53
I<tid> is the internal timer id, a unique string.
 
54
 
 
55
I<$time> is the string 'idle', representing an idle queue timer, or a
 
56
integer millisecond value.
 
57
 
 
58
I<once> or I<repeat> specifies whether the timer is a one-time B<after>
 
59
event, or a repeating B<repeat> event.
 
60
 
 
61
I<callback> specifies a Perl/Tk Tk::Callback object.
 
62
 
 
63
=head1 Changing a B<repeat> timer interval 
 
64
 
 
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.
 
70
 
 
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. 
 
74
 
 
75
=head1 The after() method has several forms as follows:
45
76
 
46
77
=over 4
47
78
 
73
104
 
74
105
=item I<$widget>-E<gt>B<afterCancel>(I<$id>)
75
106
 
76
 
=item I<$id>-E<gt>cancel
 
107
=item I<$id>-E<gt>B<cancel>
77
108
 
78
109
Cancels the execution of a delayed command that
79
110
was previously scheduled.
104
135
 
105
136
=item I<$widget>-E<gt>B<afterInfo>?(I<$id>)?
106
137
 
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
115
 
handler it is.
 
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.
116
150
 
117
151
=back
118
152