home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!ulysses!vek
- From: vek@allegra.att.com (Van Kelly)
- Newsgroups: comp.lang.tcl
- Subject: Periodic Actions in Tcl/Tk
- Message-ID: <VEK.92Aug31115650@rover.allegra.att.com>
- Date: 31 Aug 92 15:56:50 GMT
- Sender: netnews@ulysses.att.com
- Organization: AT&T Bell Laboratories, Murray Hill, NJ, USA
- Lines: 16
-
-
- What is the best way to define a period action (say, once every n seconds)
- in a Tcl/TclX/Tk environment, given that there may be a number of these
- one might wish to set up and later selectively cancel at a later date.
-
- The first thing I thought of was to have a global variable, say FOO,
- containing the code for a periodic action followed by an after command
- to re-evaluate itself. But this is obviously tail-recursive and may
- explode its stack pretty fast. If one could define a bunch of
- pseudo-clocks as normal X-events to which one could bind actions, that would
- clearly be a better approch, but there's no obvious way to do this in Tcl(X).
-
- Any advice? Email responses and followup posts are both satisfactory.
-
- Van Kelly
- vek@allegra.att.com
-