in reply to Re: Interrupting a loop
in thread Interrupting a loop

To emphasise a point in choroba's excellent thought: when you want to juggle multiple events (a signal/button-click AND elapsed time), you need to stay in the idiom of the relevant event loop. In Tk, that's why you'd want to do the time-delay with Tk::after, not with sleep, so the event loop can quietly also watch for the button-click etc and react; sleep just suspends the whole process until the OS sends it a SIGALRM.