tk/after

This command is used to delay execution of the program or to execute a command in background sometime in the future. It has several forms, depending on the first argument to the command:

(tk/after ms)
Ms must be an integer giving a time in milliseconds. The command sleeps for ms milliseconds and then returns. While the command is sleeping the application does not respond to events.
(tk/after ms (lambda () ... ) ?(lambda () ... ) ...?)
In this form the command returns immediately, but it arranges for a lambda expression to be executed ms milliseconds later as an event handler. The command will be executed exactly once, at the given time.

The after command returns an identifier that can be used to cancel the delayed command using after cancel.

Note that the command (tk/after idle) is not supported. It will crash your application.


Corresponding Tcl/Tk command:

after ...

© Author | Home | Sitemap