Tk Invokes focused widgets on Alt-Space



Here is a simple script:

checkbutton .but1 -text "Do something but not on Alt-Space"
button .but2 -text "Do something but not on Alt-Space" -command exit
pack .but1 .but2

On Windows, when an Alt-Space event comes the buttons (provided they
have focus) will see the space and/or Alt key events and will be
invoked. This seems to have been the case in all previous versions I
have lying around including 8.4.14.

Surely this is not a good idea. Checkbuttons could be set/buttons
invoked unintentionally before the window is closed.

Has anyone noticed this or know of a workaround? I presume its the
default bindings not handling this special case.

.


Quantcast