[Tkinter-discuss] after_cancel?

Wayne Watson sierra_mtnview at sbcglobal.net
Tue Apr 21 15:14:35 CEST 2009


Thanks. The code I'm looking at, not mine, has the concept of an "after" 
video event (it takes about 8 seconds)  that added some confusion to 
what the code does. I wasn't sure if the after_cancel wasn't related to 
it and some Tk widget.

Jeff Epler wrote:
> after, after_idle, and after_cancel map to the 3 main forms of the tcl
> "after" command.
>
>     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: 
>
>     [...]
>     after cancel id
>         Cancels the execution of a delayed command that was previously
>         scheduled. Id indicates which command should be canceled; it
>         must have been the return value from a previous after command. If the
>         command given by id has already been executed then the after cancel
>         command has no effect. 
>
>     -- from http://www.tcl.tk/man/tcl8.4/TclCmd/after.htm
>
> One use of "after" is in autoscrolling or autorepeat.  When the starting
> event is seen, the repeat is scheduled with "after".  Each time the
> repeat runs, it schedules itself again with "after".  When the ending
> event is seen, the repeat is cancelled with "after cancel".  To do this,
> tue id returned by the last "after" is stored somewhere.
>
> Jeff
>
>   

-- 
           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
              Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet  

           All the neutrons, and protons in the human body occupy
           a cube whose side is 5.52*10**-6 meters (tiny!). That
           adds up to a 150 pound person. It's not a surprise that
           we are mostly space. (Calculation by WTW)
 



More information about the Tkinter-discuss mailing list