Tkinter: How to use threads to preventing main event loop from “freezing”

后端 未结 4 861
囚心锁ツ
囚心锁ツ 2020-11-21 23:25

I have a small GUI test with a \"Start\" button and a Progress bar. The desired behavior is:

  • Click Start
  • Progressbar oscillates for 5 seconds
4条回答
  •  独厮守ぢ
    2020-11-22 00:15

    The problem is that t.join() blocks the click event, the main thread does not get back to the event loop to process repaints. See Why ttk Progressbar appears after process in Tkinter or TTK progress bar blocked when sending email

提交回复
热议问题