tkr.mainloop runs processing events for the TK window until the TK window is closed - at which time the run flag is set to stop, stoping the other thread.
View entire thread