0
votes

I am writing a Tkinter App which does some long running operation. In order to prevent Tkinter window from hanging, i am introducing threading :- one thread for performing long running operation, second thread will be for updating GUI based on the QUEUE which will be filled by long running operation. Now I am thinking of running Tkinter mainloop in a separate thread instead of main thread, reason being is I want to update the state of GUI (Configure some buttons), only once the long running thread is complete. If I run the Tkinter mainloop in main thread, it won't wait for long running thread to complete and will update the GUI before it. So is it safe if i run Tkinter main loop in separate thread and in main loop wait for long running thread to complete before other updates? Any other ideas for this problem?

1

1 Answers

1
votes

It is my understanding that tk needs to be run in the main thread.