I want my start_button (labeled "End" on the start_frame) to bring the end_frame to the front. This should display the end_button (labeled "Start" on the end_frame).
I then want the end_button (labeled "Start") to bring the user back to the start_frame by lifting it to the top.
This would basically toggle the start_frame and the end_frame by bringing either one to the top using the buttons.
However, my lift() function isn't moving things to the top. I know lift() can't move children frames above their parents, but I don't think I made that mistake. Where am I going wrong?
import Tkinter as tk
root = tk.Tk()
root.geometry("400x400")
#create main frame for window. This will hold all pages of the menu.
container = tk.Frame(root)
container.pack(side="top", fill="both", expand=True)
container.grid_rowconfigure(0, weight=1)
container.grid_columnconfigure(0, weight=1)
#create subframes
start_frame = tk.Frame(container)
start_frame.grid(row=0, column=0, sticky="nsew", in_ = container)
end_frame = tk.Frame(container)
end_frame.grid(row=0, column=0, sticky="nsew", in_ = container)
#create UI widgets for subframew
start_button = tk.Button(start_frame, text="End", fg="blue", command = end_frame.lift())
start_button.pack(side = tk.BOTTOM)
end_button = tk.Button(end_frame, text="Start", fg="blue", command = start_frame.lift())
end_button.pack(side = tk.BOTTOM)
root.mainloop()
EDIT : I have tried calling start_button.lift() and end_button.lift(), but it gives me the same result.