I am currently struggling to create a tkinter Project which includes several Windows. All I want is to go forward regularly through my program and backwards step by step. After a lot of research I am struggling to find an example explaining how to do it.
I tried to create a minimal example following several posts but it isn't working yet and I don't really understand what I am doing to be honest.
My biggest reference is this post here but it's quite long and complex: tkinter - Going Back and Forth Between Frames Using Buttons
This example here on the other hand isn't quite enough for me to get it. Both combined and explained might do the trick already: Tkinter open and close Toplevel windows
- Can you help me create a minimal example (with or without the code for the actual window)?
- And explain what is going on. I assume it's simple so explanations can be fairly short I guess. (If you know of a tutorial site explaining it well I would be happy as well)
Thanks in advance, hopefully we can create a helpful resource for me and others.
def Forward(self):
# Open secondary Window
Secondary_Win = Toplevel()
#Close primary Window
Main_Win.withdraw() #.deiconify() to show again
Main_Win.destroy()
def Backward(self):
# Close secondary Window
Secondary_Win.withdraw
#Open primary Window
Main_Win.deiconify()
EDIT: as @stovfl pointed out to clarify: I want to switch between actual Windows not just framees. Sorry for the wording hiccup.