Closing a child window using Tkinter???

G. Willoughby thecalm at NOSPAM.btinternet.com
Tue Jun 26 18:53:51 EDT 2001


This is the code i am using to display a new window from another window, but
when i click the close button it closes the whole program when i only want
to close the new 'child' window. any ideas whats wrong?  ta.

def newWindow():
    aboutbox=Toplevel()
    aboutbox.resizable(0, 0)
    aboutbox.title("About...")
    aboutFrame = Frame(aboutbox, bd=1, relief=SUNKEN)
    aboutFrame.pack()
    Label(aboutFrame, text="Testing...", wraplength=300, justify=LEFT,
padx=10, pady=10).grid(row=0, column=0, sticky=W+E)
    Button(aboutFrame, text="Close", width=15, relief=GROOVE,
command=aboutbox.quit).grid(row=1, column=0, padx=10, pady=10)

Gaz.





More information about the Python-list mailing list