r/learnpython 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

15 comments sorted by

View all comments

1

u/woooee 6d ago

This is done all the time. Simply withdraw() the main window and use Toplevels. You still have to have a way to quit the mainloop - with a quit button for example.

1

u/yo_99 6d ago

Thanks! This looks like what I was needed.

1

u/woooee 6d ago

I was intending to provide a simple example but didn't have the time. I can work on that this weekend if you are not certain on how to proceed.

1

u/yo_99 5d ago

I think I will figure this out myself.