On Windows, when an Alt-Space event occurs to show the "Windows system menu", the buttons and checkbuttons (provided they have focus) will see the space and/or Alt key events and are invoked.
This trivial script shows the misbehaviour. Alt-Space should never cause the checkbutton to be toggled or the button to be invoked.
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
Logged In: YES
user_id=988604
Originator: NO
The problem appears to be that (to quote the manual):
"For a binding to match a given event, the modifiers in the event must include all of those specified in the event pattern. An event may also contain additional modifiers not specified in the binding. For example, if button 1 is pressed while the shift and control keys are down, the pattern <Control-Button-1> will match the event, but <Mod1-Button-1> will not."
In other words, the binding for Button for the <Key-space> event, which invokes the button, will also fire for Alt-space, Control-space, etc.
I notice that when using an Entry, however, no space is inserted into the entry box when Alt-space is pressed. This is because the Entry widget has a general binding for the Alt modifier as follows
% bind Entry <Alt-Key>
# nothing
A similar command added to the bindings for Button solves this problem.
% bind Button <Alt-Key> {# nothing}