wxPython: EVT_KEY_DOWN isn't caught

Robin Dunn robin at alldunn.com
Mon Nov 13 20:01:20 CET 2000

In article <8ugpvu$qa5$1 at nnrp1.deja.com>,
  rerwig at my-deja.com wrote:
> Issueing the following code (cut and pasted from demo code) doesn't
> to catch the EVT_KEY_DOWN. What am I doing wrong?

The key events are sent to the window with the focus, and since it is
not a "command" event it is not propogated up the containment hierarchy,
which is why you are not seeing it in your handler attached to the
frame.  In your example the focus is problably on on of the text

You can hook an event handler to any window just by using it as the
first parameter in the EVT_* call.  Any callable object can be used,
even methods of some other window such as your frame.

Robin Dunn
Software Craftsman
robin at AllDunn.com
http://wxPython.org     Java give you jitters?
http://wxPROs.com        Relax with wxPython!

Sent via Deja.com http://www.deja.com/
Before you buy.

More information about the Python-list mailing list