Problems with after_cancel()

Marc mnations at airmail.net
Tue Jul 23 17:47:28 EDT 2002


!Sorry if this is a repost. I'm not sure if the original one made it!

I have what I think is a very simple after() call and after_cancel combo:

...
def check():
    print "in check"
    if globals.stop.isSet():
        globals.status.clear()
        globals.stop.clear()
        print "Application is stopped"
    return globals.master.after(100, check)

def function(gui):
    gui.print("do something")
    id2 = check()

    print id2
    globals.master.after_cancel(id2)
    print "Should be stopped"
...

Check is called to begin the process and returns id2, which should be the id
for the after command. When I print the value of id2, I get something like
"after#25". But when I do the after_cancel command, it doesn't stop. As far
as I can tell, this is the right way to do it, but it's not working.

Could someone please tell me what the problem is?
Thanks,
Marc



More information about the Python-list mailing list