]> www.wagner.pp.ru Git - oss/ck.git/blob - doc/after.n
Ck console graphics toolkit
[oss/ck.git] / doc / after.n
1 '\"
2 '\" Copyright (c) 1990-1994 The Regents of the University of California.
3 '\" Copyright (c) 1994-1995 Sun Microsystems, Inc.
4 '\" Copyright (c) 1996-1999 Christian Werner
5 '\"
6 '\" See the file "license.terms" for information on usage and redistribution
7 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 '\" 
9 .so man.macros
10 .TH after n 8.0 Ck "Ck Built-In Commands"
11 .BS
12 '\" Note:  do not modify the .SH NAME line immediately below!
13 .SH NAME
14 after \- Execute a command after a time delay
15 .SH SYNOPSIS
16 \fBafter \fIms\fR
17 .br
18 \fBafter \fIms \fR?\fIscript script script ...\fR?
19 .br
20 \fBafter cancel \fIid\fR
21 .br
22 \fBafter cancel \fIscript script script ...\fR
23 .br
24 \fBafter idle \fR?\fIscript script script ...\fR?
25 .BE
26
27 .SH DESCRIPTION
28 .PP
29 This command is used to delay execution of the program or to execute
30 a command in background after a delay.  It has several forms,
31 depending on the first argument to the command:
32 .TP
33 \fBafter \fIms\fR
34 \fIMs\fR must be an integer giving a time in milliseconds.
35 The command sleeps for \fIms\fR milliseconds and then returns.
36 While the command is sleeping the application does not respond to
37 keypresses or any other events.
38 .TP
39 \fBafter \fIms \fR?\fIscript script script ...\fR?
40 In this form the command returns immediately, but it arranges
41 for a Tcl command to be executed \fIms\fR milliseconds later as a
42 background event handler.
43 The delayed command is formed by concatenating all the \fIscript\fR
44 arguments in the same fashion as the \fBconcat\fR command.
45 The command will be executed at global level (outside the context
46 of any Tcl procedure).
47 If an error occurs while executing the delayed command then the
48 \fBtkerror\fR mechanism is used to report the error.
49 The \fBafter\fR command returns an identifier that can be used
50 to cancel the delayed command using \fBafter cancel\fR.
51 .TP
52 \fBafter cancel \fIid\fR
53 Cancels the execution of a delayed command that
54 was previously scheduled.
55 \fIId\fR indicates which command should be canceled;  it must have
56 been the return value from a previous \fBafter\fR command.
57 If the command given by \fIid\fR has already been executed then
58 the \fBafter cancel\fR command has no effect.
59 .TP
60 \fBafter cancel \fIscript script ...\fR
61 This command also cancels the execution of a delayed command.
62 The \fIscript\fR arguments are concatenated together with space
63 separators (just as in the \fBconcat\fR command).
64 If there is a pending command that matches the string, it is
65 cancelled and will never be executed;  if no such command is
66 currently pending then the \fBafter cancel\fR command has no effect.
67 .TP
68 \fBafter idle \fIscript \fR?\fIscript script ...\fR?
69 Concatenates the \fIscript\fR arguments together with space
70 separators (just as in the \fBconcat\fR command), and arranges
71 for the resulting script to be evaluated later as an idle handler
72 (the script runs the next time the Tk event loop is entered
73 and there are no events to process).
74 The command returns an identifier that can be used
75 to cancel the delayed command using \fBafter cancel\fR.
76 If an error occurs while executing the script then the
77 \fBtkerror\fR mechanism is used to report the error.
78
79 .SH "SEE ALSO"
80 tkerror
81
82 .SH KEYWORDS
83 cancel, delay, sleep, time