summaryrefslogtreecommitdiffstats
path: root/doc/after.n
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:24:37 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-10-27 14:24:37 (GMT)
commitf2710bf0bb0c6ace5d1bc4f424b400537ffdb21c (patch)
treec19b22fbb2165682630fecbf3779e53b26c9002f /doc/after.n
parent4c2d0f20bfa9108949678cf49bfdc58eedc7bb93 (diff)
downloadtcl-f2710bf0bb0c6ace5d1bc4f424b400537ffdb21c.zip
tcl-f2710bf0bb0c6ace5d1bc4f424b400537ffdb21c.tar.gz
tcl-f2710bf0bb0c6ace5d1bc4f424b400537ffdb21c.tar.bz2
More minor doc fixes
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 6e6ab1a..5cabb98 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.5 2004/10/27 09:36:58 dkf Exp $
+'\" RCS: @(#) $Id: after.n,v 1.6 2004/10/27 14:24:37 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