Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/doc/update.n @ 25

Last change on this file since 25 was 25, checked in by landauf, 16 years ago

added tcl to libs

File size: 2.3 KB
Line 
1'\"
2'\" Copyright (c) 1990-1992 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'\" RCS: @(#) $Id: update.n,v 1.10 2007/12/13 15:22:33 dgp Exp $
9'\"
10.so man.macros
11.TH update n 7.5 Tcl "Tcl Built-In Commands"
12.BS
13'\" Note:  do not modify the .SH NAME line immediately below!
14.SH NAME
15update \- Process pending events and idle callbacks
16.SH SYNOPSIS
17\fBupdate\fR ?\fBidletasks\fR?
18.BE
19
20.SH DESCRIPTION
21.PP
22This command is used to bring the application
23.QW "up to date"
24by entering the event loop repeatedly until all pending events
25(including idle callbacks) have been processed.
26.PP
27If the \fBidletasks\fR keyword is specified as an argument to the
28command, then no new events or errors are processed;  only idle
29callbacks are invoked.
30This causes operations that are normally deferred, such as display
31updates and window layout calculations, to be performed immediately.
32.PP
33The \fBupdate idletasks\fR command is useful in scripts where
34changes have been made to the application's state and you want those
35changes to appear on the display immediately, rather than waiting
36for the script to complete.  Most display updates are performed as
37idle callbacks, so \fBupdate idletasks\fR will cause them to run.
38However, there are some kinds of updates that only happen in
39response to events, such as those triggered by window size changes;
40these updates will not occur in \fBupdate idletasks\fR.
41.PP
42The \fBupdate\fR command with no options is useful in scripts where
43you are performing a long-running computation but you still want
44the application to respond to events such as user interactions;  if
45you occasionally call \fBupdate\fR then user input will be processed
46during the next call to \fBupdate\fR.
47.SH EXAMPLE
48Run computations for about a second and then finish:
49.CS
50set x 1000
51set done 0
52after 1000 set done 1
53while {!$done} {
54    # A very silly example!
55    set x [expr {log($x) ** 2.8}]
56
57    # Test to see if our time-limit has been hit.  This would
58    # also give a chance for serving network sockets and, if
59    # the Tk package is loaded, updating a user interface.
60    \fBupdate\fR
61}
62.CE
63
64.SH "SEE ALSO"
65after(n), interp(n)
66
67.SH KEYWORDS
68event, flush, handler, idle, update
Note: See TracBrowser for help on using the repository browser.