Hacker News new | past | comments | ask | show | jobs | submit login

The pomodoro example seems to be updating the UI from a background thread. The TkDocs tutorial [1] advices against this and suggests posting a custom event to the main thread instead.

Using the after or after_idle methods [2] to post a callback to the main thread also works, and seems easier to me since it allows you to pass arguments.

In this particular example, where the background thread is just used as a timer, you could remove the threading entirely if you use after to let Tkinter handle the timer.

[1] https://tkdocs.com/tutorial/eventloop.html#threads

[2] https://tkdocs.com/shipman/universal.html




Thank you for the suggestion I'll update my code to use after instead!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: