Since the thread running the timer loop in examples/window_title_change.py is not a daemon thread, the program will not exit when the main thread ends due to the window closing.
Instead of using an uninterruptible sleep, we can use the window closed event as the timer with the added bonus that we can exit the timer loop when the window is closed so that the program can exit.
Since the thread running the timer loop in
examples/window_title_change.py
is not a daemon thread, the program will not exit when the main thread ends due to the window closing.Instead of using an uninterruptible sleep, we can use the window closed event as the timer with the added bonus that we can exit the timer loop when the window is closed so that the program can exit.