summaryrefslogtreecommitdiffstats
path: root/doc/after.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:23:38 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:23:38 (GMT)
commit45beb64f7dcb09a6ce83532702bca760f72e6f4d (patch)
treef7746a2a8316d612570e1456524e3d182e855c82 /doc/after.n
parent5bc57d7b0f63d86fc383565d69f7704943fff94d (diff)
downloadtcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.zip
tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.tar.gz
tcl-45beb64f7dcb09a6ce83532702bca760f72e6f4d.tar.bz2
Yet more doc update backporting
Diffstat (limited to 'doc/after.n')
-rw-r--r--doc/after.n18
1 files changed, 7 insertions, 11 deletions
diff --git a/doc/after.n b/doc/after.n
index 4db2815..ea6aa0b 100644
--- a/doc/after.n
+++ b/doc/after.n
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: after.n,v 1.3.18.1 2004/10/27 09:35:38 dkf Exp $
+'\" RCS: @(#) $Id: after.n,v 1.3.18.2 2004/10/27 14:23:41 dkf Exp $
'\"
.so man.macros
.TH after n 7.5 Tcl "Tcl Built-In Commands"
@@ -101,24 +101,21 @@ will not be executed unless the application enters the event loop.
In applications that are not normally event-driven, such as
\fBtclsh\fR, the event loop can be entered with the \fBvwait\fR
and \fBupdate\fR commands.
-
.SH "EXAMPLES"
This defines a command to make Tcl do nothing at all for \fIN\fR
seconds:
-
.CS
proc sleep {N} {
- \fBafter\fR [expr {int($N * 1000)}]
+ \fBafter\fR [expr {int($N * 1000)}]
}
.CE
-
+.PP
This arranges for the command \fIwake_up\fR to be run in eight hours
(providing the event loop is active at that time):
-
.CS
\fBafter\fR [expr {1000 * 60 * 60 * 8}] wake_up
.CE
-
+.PP
The following command can be used to do long-running calculations (as
represented here by \fI::my_calc::one_step\fR, which is assumed to
return a boolean indicating whether another step should be performed)
@@ -129,12 +126,11 @@ processing steps (arranging for the next step to be done using an
already-triggered timer event only when the event queue has been
drained) and is useful when you want to ensure that a Tk GUI remains
responsive during a slow task.
-
.CS
proc doOneStep {} {
- if {[::my_calc::one_step]} {
- \fBafter\fR idle [list \fBafter\fR 0 doOneStep]
- }
+ if {[::my_calc::one_step]} {
+ \fBafter idle\fR [list \fBafter\fR 0 doOneStep]
+ }
}
doOneStep
.CE