I'm trying to pack something in Tkinter from a separate thread. I keep getting a RuntimeError.
Specifically: RuntimeError: main thread is not in main loop
The question is: How do I update the GUI (mainloop) from a separate thread?
The source of the issue:
def protocol(self, scheduleName): #ran as thread
print("Getting courses")
self.coursesLabel.pack() #throws the error
...
I want to be able to pack items from this thread to mainloop(). I'm not sure how to transfer this between two threads.
Thanks in advance for the help!
EDIT: Most of these questions that already exist respond to people who are running two separate GUIs simultaneously. I just need to know how to pack things from one thread to another, not something as complex as running two GUIs at the same time. Most answers also used Queues, and I was wondering if there was a more elegant way to pack things from separate threads.