wxPython: Intercepting keyboard events from multiple widgets?

Greg Ewing (using news.cis.dfn.de) ckea25d02 at sneakemail.com
Fri Apr 18 00:29:37 EDT 2003


Donnal Walter wrote:
> Would an accelerator table do the job?
> 
> http://www.wxwindows.org/manuals/2.4.0/wx28.htm#wxacceleratortable

That seems to work, thanks. I'm not sure it's exactly
what I want, because sometimes some controls might
need to override some of the accelerators. But it
will do for a start.

I have another problem now. I've set up an Edit
menu with wxID_CUT etc. in the appropriate places.
According to the docs wxTextCtrl is supposed to
come with default event bindings for these, but
they don't seem to do anything.

And if I try to
use EVT_MENU to explicitly attach a handler for
one of them to a wxTextCtrl, it never gets called,
although if I do that for the parent window of the
wxTextCtrl (which is a wxNotebook) it does get called.
It's as though the menu event is not being delivered to the
control itself, but to its parent.

Is there anything special I have to do to get menu
events delivered to text controls?

Thanks,

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg





More information about the Python-list mailing list