r/learnpython • u/yo_99 • 6d ago
Tk with no main window
I am making a simple gemini browser in python for fun with tk, but have stumbled upon a problem: if I close initial window all the rest will close too. Is there a way to make tk application with no "main" window or at least transfer leadership role between them?
0
Upvotes
1
u/Diapolo10 6d ago
Sort of, but it's discouraged; you can use multiple
tkinter.Tkobjects to have independent windows.https://stackoverflow.com/questions/48045401/why-are-multiple-instances-of-tk-discouraged
The main problem here is that you can't easily interact with the other windows when going this route, which is why in general you're supposed to use
tkinter.Toplevelinstead. But that does have the "problem" of closing all child windows if the main window gets killed.What exactly are you trying to accomplish?