By "cancelling" a window, I assume you mean "destroy" it? The
destroy command completely destroys one or more widgets. It also destroys any children of that widget (for example, other widgets managed by a frame). As you've seen, Tcl requires all widgets to have unique names, so it's an error to create a widget with the name of an existing widget.
By the way, if you've got a widget or toplevel window that you want to display and hide repeatedly in a program, you don't have to
destroy it; you can instead temporarily hide it. The
pack forget and
grid forget commands remove from the screen a widget previously
packed or
gridded. You can then
pack or
grid them again later without having to recreate them from scratch. And for a toplevel window, you can use
wm withdraw to hide it and
wm deiconify to redisplay it. - Ken Jones, President
Avia Training and Consulting
866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax