I think I'm missing something basic about Tkinter.
What would be the correct way to create several windows with the same hidden root window? I can get one window to open, but once it's closed subsequent ones show up blank, without any widgets in them. I've also noticed if I leave the root window visible, it disappears when I close the first "real" window.
I would post code, but I haven't been able to figure out what causes the behavior, and my actual code is fairly complicated, and has to run inside another (even more complicated) program.
I've tried using .quit()
or .destroy()
to close windows, and put mainloop()
s and wait_window()
loops in different places, but everything either still has the error or something worse goes wrong. I guess what I'm looking for is just a different perspective.
My problem seems similar to the one here, but I haven't been able to gain anything new from the answer.
Any ideas? I know this is a little vague. Thanks
SOLVED:
This probably won't help anyone, but I figured out the problem. I have several classes of windows, each derived from Tkinter.Toplevel. In my base Window
class I made a close()
function that calls self.destroy()
. Then in its subclasses I added custom code to store their geometry etc, and finally called Window.close(self)
. Something about that doesn't work, because if I just use self.quit()
instead of invoking the superclass's close()
, everything is fine.