[wxPython-users] Ampersands and static text
John Clark
clajo04 at mac.com
Tue Apr 24 13:16:19 PDT 2007
Guilherme Polo <mailto:ggpolo at gmail.com> scribbled on Tuesday, April 24,
2007 3:39 PM:
> 2007/4/24, Bob Klahn <bobstones at comcast.net>:
>> When I press Alt-S, I get "Button1 was clicked"! What's going on
>> here??
>>
>> Bob
>
> Uhm.. not here.
>
It may just be a windows thing, but what normally happens under windows is
if you key in the keyboard shortcut for a static text control, the next
control in the tab order of the window takes focus. This allows you to put
labels in front of text entry boxes and have the window act as you expect it
to. I think in this case because the static text control is the last
control added to the window, the processing is wrapping around and
activating the first button on the window.
You can see this if you alter the order that the objects are added to the
window - unless the static text control is last, keying in it's shortcut
will cause the next button added to click.
I'm not sure why the button would be registering a click event, as it should
only be taking focus in the window.
Hopefully Robin can comment on why the button would be registering a
click...
-jdc
More information about the wxpython-users
mailing list