Hi,
I have got a small problem with the binding of the shortcut Alt-o to
close a window.
Here is the example code:
--- snip ---
proc handleOk {w} {
destroy $w
}
set w .sub_window
toplevel $w -class Dialog
wm title $w "Test Window"
button $w.button -text "OK" -underline 0 \
-command [list handleOk $w]
pack $w.button
bind $w <Escape> [list handleOk $w]
bind $w <Alt-KeyPress-o> [list handleOk $w]
--- snip ---
If I press Escape the window closes. If I press Alt-o the window closes
but I get the following error message in addition:
bad window path name ".sub_window"
bad window path name ".sub_window"
while executing
"winfo class $w"
(procedure "tk::TraverseToMenu" line 6)
invoked from within
"tk::TraverseToMenu .sub_window o"
(command bound to event)
I would suppose that there is a sanity check missing wether $w still
exists. (It is interesting that there is this difference between Escape
and Alt-o.)
The problem is in Tcl/Tk 8.4, 8.5, and the latest 8.6.4.
Best regards,
Frank
--- news://
freenews.netfront.net/ - complaints:
ne...@netfront.net ---