Edit:
let me include my code so I can get some specific help.
import Tkinter
def goPush():
win2=Tkinter.Toplevel()
win2.geometry('400x50')
Tkinter.Label(win2,text="If you have prepared as Help describes select Go otherwise select Go Back").pack()
Tkinter.Button(win2,text="Go",command=bounceProg).pack(side=Tkinter.RIGHT,padx=5)
Tkinter.Button(win2, text="Go Back", command=win2.destroy).pack(side=Tkinter.RIGHT)
def bounceProg():
d=1
print d
root=Tkinter.Tk()
root.geometry('500x100')
Tkinter.Button(text='Go', command=goPush).pack(side=Tkinter.RIGHT,ipadx=50)
root.mainloop()
So when you run the program it opens a window that says Go. Then Go opens a window that asks if youve read the help(which I didnt include in this code sample) and offers Go Back(which goes back) and Go. When you select Go it calls a function which prints 1. After it prints 1 I want the Window to close returning to the original window containing the Go button. How do I do such a thing?
@Kosig It won’t quit root. Ie.
self.foo = tk.Toplevel(self)and thenself.foo.destroy()For example:
You have one main object, which is Foo. Foo has one main window (called “frame”), which it gets from
tk.Frame. Afterwards, all Toplevel windows (frames) must be created within it. So, your new window here isself.window_barand all its “objects” are in there, including the method for destroying it (self.window_bar.destroy()). You can callself.window_bar.destroy()from any part of the code, but here it is called after the user clicks “no”.