Imported upstream version 1.5
[manpages-zh.git] / src / mann / after.n
blob31252e6089f8da03c53350f6ed7137b1294f072f
1 '\"
2 '\" Copyright (c) 1990-1994 The Regents of the University of California.
3 '\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
4 '\"
5 '\" See the file "license.terms" for information on usage and redistribution
6 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
7 '\"
8 '\"
9 '\" The definitions below are for supplemental macros used in Tcl/Tk
10 '\" manual entries.
11 '\"
12 '\" .AP type name in/out ?indent?
13 '\" Start paragraph describing an argument to a library procedure.
14 '\" type is type of argument (int, etc.), in/out is either "in", "out",
15 '\" or "in/out" to describe whether procedure reads or modifies arg,
16 '\" and indent is equivalent to second arg of .IP (shouldn't ever be
17 '\" needed; use .AS below instead)
18 '\"
19 '\" .AS ?type? ?name?
20 '\" Give maximum sizes of arguments for setting tab stops. Type and
21 '\" name are examples of largest possible arguments that will be passed
22 '\" to .AP later. If args are omitted, default tab stops are used.
23 '\"
24 '\" .BS
25 '\" Start box enclosure. From here until next .BE, everything will be
26 '\" enclosed in one large box.
27 '\"
28 '\" .BE
29 '\" End of box enclosure.
30 '\"
31 '\" .CS
32 '\" Begin code excerpt.
33 '\"
34 '\" .CE
35 '\" End code excerpt.
36 '\"
37 '\" .VS ?version? ?br?
38 '\" Begin vertical sidebar, for use in marking newly-changed parts
39 '\" of man pages. The first argument is ignored and used for recording
40 '\" the version when the .VS was added, so that the sidebars can be
41 '\" found and removed when they reach a certain age. If another argument
42 '\" is present, then a line break is forced before starting the sidebar.
43 '\"
44 '\" .VE
45 '\" End of vertical sidebar.
46 '\"
47 '\" .DS
48 '\" Begin an indented unfilled display.
49 '\"
50 '\" .DE
51 '\" End of indented unfilled display.
52 '\"
53 '\" .SO
54 '\" Start of list of standard options for a Tk widget. The
55 '\" options follow on successive lines, in four columns separated
56 '\" by tabs.
57 '\"
58 '\" .SE
59 '\" End of list of standard options for a Tk widget.
60 '\"
61 '\" .OP cmdName dbName dbClass
62 '\" Start of description of a specific option. cmdName gives the
63 '\" option's name as specified in the class command, dbName gives
64 '\" the option's name in the option database, and dbClass gives
65 '\" the option's class in the option database.
66 '\"
67 '\" .UL arg1 arg2
68 '\" Print arg1 underlined, then print arg2 normally.
69 '\"
70 '\"
71 '\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
72 .if t .wh -1.3i ^B
73 .nr ^l \n(.l
74 .ad b
75 '\" # Start an argument description
76 .de AP
77 .ie !"\\$4"" .TP \\$4
78 .el \{\
79 . ie !"\\$2"" .TP \\n()Cu
80 . el .TP 15
81 .\}
82 .ta \\n()Au \\n()Bu
83 .ie !"\\$3"" \{\
84 \&\\$1 \\fI\\$2\\fP (\\$3)
85 .\".b
86 .\}
87 .el \{\
88 .br
89 .ie !"\\$2"" \{\
90 \&\\$1 \\fI\\$2\\fP
91 .\}
92 .el \{\
93 \&\\fI\\$1\\fP
94 .\}
95 .\}
97 '\" # define tabbing values for .AP
98 .de AS
99 .nr )A 10n
100 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
101 .nr )B \\n()Au+15n
103 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
104 .nr )C \\n()Bu+\\w'(in/out)'u+2n
106 .AS Tcl_Interp Tcl_CreateInterp in/out
107 '\" # BS - start boxed text
108 '\" # ^y = starting y location
109 '\" # ^b = 1
110 .de BS
112 .mk ^y
113 .nr ^b 1u
114 .if n .nf
115 .if n .ti 0
116 .if n \l'\\n(.lu\(ul'
117 .if n .fi
119 '\" # BE - end boxed text (draw box now)
120 .de BE
122 .ti 0
123 .mk ^t
124 .ie n \l'\\n(^lu\(ul'
125 .el \{\
126 .\" Draw four-sided box normally, but don't draw top of
127 .\" box if the box started on an earlier page.
128 .ie !\\n(^b-1 \{\
129 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
131 .el \}\
132 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
137 .nr ^b 0
139 '\" # VS - start vertical sidebar
140 '\" # ^Y = starting y location
141 '\" # ^v = 1 (for troff; for nroff this doesn't matter)
142 .de VS
143 .if !"\\$2"" .br
144 .mk ^Y
145 .ie n 'mc \s12\(br\s0
146 .el .nr ^v 1u
148 '\" # VE - end of vertical sidebar
149 .de VE
150 .ie n 'mc
151 .el \{\
152 .ev 2
154 .ti 0
155 .mk ^t
156 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
157 .sp -1
161 .nr ^v 0
163 '\" # Special macro to handle page bottom: finish off current
164 '\" # box/sidebar if in box/sidebar mode, then invoked standard
165 '\" # page bottom macro.
166 .de ^B
167 .ev 2
168 'ti 0
170 .mk ^t
171 .if \\n(^b \{\
172 .\" Draw three-sided box if this is the box's first page,
173 .\" draw two sides but no top otherwise.
174 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
175 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
177 .if \\n(^v \{\
178 .nr ^x \\n(^tu+1v-\\n(^Yu
179 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
184 .if \\n(^b \{\
185 .mk ^y
186 .nr ^b 2
188 .if \\n(^v \{\
189 .mk ^Y
192 '\" # DS - begin display
193 .de DS
198 '\" # DE - end display
199 .de DE
204 '\" # SO - start of list of standard options
205 .de SO
206 .SH "STANDARD OPTIONS"
209 .ta 4c 8c 12c
210 .ft B
212 '\" # SE - end of list of standard options
213 .de SE
215 .ft R
217 See the \\fBoptions\\fR manual entry for details on the standard options.
219 '\" # OP - start of full description for a single option
220 .de OP
223 .ta 4c
224 Command-Line Name: \\fB\\$1\\fR
225 Database Name: \\fB\\$2\\fR
226 Database Class: \\fB\\$3\\fR
230 '\" # CS - begin code excerpt
231 .de CS
234 .ta .25i .5i .75i 1i
236 '\" # CE - end code excerpt
237 .de CE
241 .de UL
242 \\$1\l'|0\(ul'\\$2
244 .TH after n 7.5 Tcl "Tcl Built-In Commands"
246 '\" Note: do not modify the .SH NAME line immediately below!
247 .SH NAME
248 after \- 延迟一段时间之后执行一个命令
249 .SH 总览 SYNOPSIS
250 \fBafter \fIms\fR
252 \fBafter \fIms \fR?\fIscript script script ...\fR?
254 \fBafter cancel \fIid\fR
256 \fBafter cancel \fIscript script script ...\fR
258 \fBafter idle \fR?\fIscript script script ...\fR?
260 \fBafter info \fR?\fIid\fR?
263 .SH 描述 DESCRIPTION
265 这个命令被用于延迟执行程序或者在将来某时在后台执行一个命令。它有几种形式,依靠给命令的第一个参数(来区分):
267 \fBafter \fIms\fR
268 \fIMs\fR 必须是整数,给出以毫秒为单位的时间。命令在睡眠(sleep) \fIms\fR 毫秒之后返回。当命令在睡眠的时候,应用不响应事件。
270 \fBafter \fIms \fR?\fIscript script script ...\fR?
271 在这种形式中,命令立即返回,它安排一个 Tcl 命令在 \fIms\fR 毫秒之后作为事件处理器(handler)来运行。在给定时间,命令将被精确的执行一次。延迟的命令是通过连接(concatenate)所有的 \fIscript\fR 参数形成的,这与 \fBconcat\fR 命令的方式(fashion)一样。命令将在全局层次上执行(在任何 Tcl 过程的上下文之外)。在执行延迟命令时如果有错误发生,则使用 \fBbgerror\fR 机制来报告错误。\fBafter\fR 命令返回一个标识符,\fBafter cancel\fR 命令用它来取消延迟的命令。
273 \fBafter cancel \fIid\fR
274 取消前面安排的延迟命令的执行。\fIId\fR 指示要取消那条命令;它必须是前面 \fBafter\fR 命令返回的。如果用 \fIid\fR 给出的命令已经执行了则 \fBafter cancel\fR 命令不起作用。
276 \fBafter cancel \fIscript script ...\fR
277 这个命令也取消一个延迟命令的执行。用空格分隔符来连接 \fIscript\fR 参数(如同在 \fBconcat\fR 命令中那样)。如果有一条等待的命令与这个字符串匹配,则取消它并永不执行;如果当前没有这样的等待命令则 \fBafter cancel\fR 命令不起作用。
279 \fBafter idle \fIscript \fR?\fIscript script ...\fR?
280 用空格分隔符连接 \fIscript\fR 参数(如同在 \fBconcat\fR 命令中那样),并被作为一个空闲回调(idle callback)来安排结果脚本在以后执行。下次进入事件循环并且没有事件要处理(的时候),这个脚本被精确的执行一次。命令返回一个标识符,\fBafter cancel\fR 命令用它来取消延迟的命令。在执行延迟命令时如果有错误发生,则使用 \fBbgerror\fR 机制来报告错误。
282 \fBafter info \fR?\fIid\fR?
283 这个命令返回关于存在的事件处理器的信息。如果没提供 \fIid\fR 参数,命令为所有通过 \fBafter\fR 命令给这个解释器建立的事件处理器返回一个标识符的列表。如果提供了 \fIid\fR,它指定一个现存的处理器;\fIid\fR 必须是以前调用 \fBafter\fR 返回的值并且仍未被触发或取消。这种情况下命令返回一个有两个元素的列表。列表的第一个元素是与 \fIid\fR 关联的脚本,第二个元素要么是 \fBidle\fR 要么是 \fBtimer\fR,指示它是那种类型的事件处理器。
285 命令的 \fBafter \fIms\fR 和 \fBafter idle\fR 形式假定应用是事件驱动的: 除非应用进入事件循环否则延迟命令将不被执行。在通常不事件驱动的应用中,如 \fBtclsh\fR,用 \fBvwait\fR 和 \fBupdate\fR 命令进入事件循环。
288 .SH "参见 SEE ALSO"
289 bgerror
291 .SH 关键字 KEYWORDS
292 cancel, delay, idle callback, sleep, time
294 .SH [中文版维护人]
295 .B 寒蝉退士
296 .SH [中文版最新更新]
297 .B 2001/06/21
298 .SH 《中国 Linux 论坛 man 手册页翻译计划》:
299 .B http://cmpp.linuxforum.net