
Jan 22nd, 1993
Version 1.0 Patchlevel 0

This is the source for an extended 'after' command for tk3.6. It is
fully compatible to the old command but introduces new subcommands which 

- query pending commands
- abort pending commands before they are executed
- prevent resubmission of identical commands
- edit the command script after the original submission.

An example application:

proc setmsg {{msg ""} {iserror 0} args} {
   if $iserror {
      blt_bell 100
      .msg configure -text [eval format {$msg} $args] -foreground red
   } else {
      .msg configure -text [eval format {$msg} $args] -foreground black
   }
   update
   if ![lempty $msg] {after unique -reschedule 4000 setmsg}
}

This proc (for the uninitiated: it uses tclX and BLT commands) 
writes a message to a label '.msg', which is erased
after 4 seconds. The last message is always readable for 4 seconds,
regardless whether there are deletion commands pending for
older messages. I use the abort and override subcommands in
applications which receive data asynchronously and in
random intervals via RPC channels. After data
has been received, replot commands are submitted but possibly removed
or edited for optimizations if a data set boundary was encountered
or the data has been deleted again before it has actually been
drawn.

Installation:
Easy. Just compile the single C file, put it into your Tk or
application library and add the call

NewAfter_Init(interp);

to your Tcl_AppInit proc.

Enjoy

W.D. Ihlenfeldt
wolf@molout.tutkie.tut.ac.jp
