Closing a child window using Tkinter???

Alex A. Nikiforov nikifor at sky.inp.nsk.su
Sun Jul 1 23:46:20 EDT 2001


G. Willoughby <thecalm at NOSPAM.btinternet.com> wrote:
> 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)
                   ^^^^ - destroy - ?
> Gaz.





More information about the Python-list mailing list