Quoting Phillip Watts <phillip.watts@anvilcom.com>:
> All below works great on Kubuntu but not WinXP.
>
> def payframe(s):
> s.f = payf.PAYF(None, -1)
> s.f.Bind(wx.EVT_KEY_DOWN,s.processkey)
> s.f.Bind(wx.EVT_TEXT_ENTER,s.procenter)Is payf.PAYF a class derived from wx.Frame? If so then that is your
problem. The EVT_KEY_DOWN event is only sent from widgets that have the
keyboard focus, and frames can not have the focus. What kind of content
is in the frame? If there are child widgets then that is where the
focus will be.Well, it works fine on Kubuntu. For instance the focus might be on a textctrl
and yet I can use pagedown to scroll a listctrl.So how would I see keyboard events, like function keys, which have to do with
controlling the app and not just the widget under focus?
Surely I don't have to bind EVT_KEY_DOWN to every textctrl.
It depends on what the behavior of the keypress should be. Perhaps
using an accelerator table would be what you want. Then you'll get a
menu event for the keypress as if it had been specified in a menu item.
Frankly, the whole business of which event bindings respond and when
is very unclear to me.
This might help:
http://wiki.wxpython.org/self.Bind%20vs.%20self.button.Bind
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!