I noticed that when you include an ampersand in the menu name, wxPython
would automatically creates an accelerator key. This is fine and I have
no problem with that. What is odd is that I can assign and change the
values of the accelerator keys of the menu items at runtime. All you
need is to press some keys.
You can test this using the demo wxMenu.py. If you press ALT-P-M, it
will assign ALT-M to the 'Mercury' menu item under 'Planet'. And if you
pressed ALT-P-L again, it will change it to ALT-L.
So is this really a feature ? How do I stop this behavior ?
I have a very strong guess that you are using the wxGTK of wxPython.
That behavior is standard for GTK - what you actually do is open the
Planet menu and press a new shortcut key, which GTK then automatically
reassigns for you.
I have no idea if this behavior can be changed, I just know that it
isn't wxPythons fault (given that you indeed use wxGTK)
···
On Fri, Dec 06, 2002 at 02:24:39PM +0800, Alfredo P. Ricafort wrote:
I noticed that when you include an ampersand in the menu name, wxPython
would automatically creates an accelerator key. This is fine and I have
no problem with that. What is odd is that I can assign and change the
values of the accelerator keys of the menu items at runtime. All you
need is to press some keys.
You can test this using the demo wxMenu.py. If you press ALT-P-M, it
will assign ALT-M to the 'Mercury' menu item under 'Planet'. And if you
pressed ALT-P-L again, it will change it to ALT-L.
So is this really a feature ? How do I stop this behavior ?
--
Anders
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/O d--@ s:+ a-- C++ $UL+++ P++ L+++ E- W+ N(+) o K? w O- M-- V
PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b+ DI+++ D+ G e- h !r y?
------END GEEK CODE BLOCK------
PGPKey: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8BFECB41
I have a very strong guess that you are using the wxGTK of wxPython.
That behavior is standard for GTK - what you actually do is open the
Planet menu and press a new shortcut key, which GTK then automatically
reassigns for you.
Yes, you're right, I'm using wxGTK. But I don't think that this is a
standard for GTK (or are you just talking about wxGTK?). I am currently
writing a small GTK program myself and I don't see this behavior.
I have no idea if this behavior can be changed, I just know that it
isn't wxPythons fault (given that you indeed use wxGTK)
AL
···
On Fri, 2002-12-06 at 17:04, Anders Bruun Olsen wrote:
I don't use GTK for programs myself other than wxGTK for wxPython, but I
have been told that this is the normal behavior for all GTK programs,
and all GTK programs I have tried it with has this behavior (I tried
amongst others XChat). Try to go to a menu, point to an entry and press
a shortcut key sequence like alt-u or something, and that sequence will
be associated with that menu entry.
···
On Fri, Dec 06, 2002 at 05:19:09PM +0800, Alfredo P. Ricafort wrote:
> I have a very strong guess that you are using the wxGTK of wxPython.
> That behavior is standard for GTK - what you actually do is open the
> Planet menu and press a new shortcut key, which GTK then automatically
> reassigns for you.
Yes, you're right, I'm using wxGTK. But I don't think that this is a
standard for GTK (or are you just talking about wxGTK?). I am currently
writing a small GTK program myself and I don't see this behavior.
--
Anders
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/O d--@ s:+ a-- C++ $UL+++ P++ L+++ E- W+ N(+) o K? w O- M-- V
PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b+ DI+++ D+ G e- h !r y?
------END GEEK CODE BLOCK------
PGPKey: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8BFECB41