[wxPython-users] Catching key events from a panel (and follow-up
to stacked panels)
Armando Serrano Lombillo
arserlom at gmail.com
Sun Feb 3 02:23:48 PST 2008
I haven't seen your code, but I've had similar problems recently which
I fixed by binding the EVT_KEY_DOWN in the App object. See this post
by Robin for a better explanation:
http://article.gmane.org/gmane.comp.python.wxpython/50485
Armando
On Feb 1, 2008 10:35 PM, Aaron MacDonald <ajmacd at ns.sympatico.ca> wrote:
> Hello,
>
> I want to capture key events somehow. My frame as a panel to which I
> try to bind to wx.EVT_KEY_DOWN, which hasn't been working. I later
> read that wx.EVT_KEY_DOWN aren't propagated and that the focus may
> probably in one of the controls/subpanels inside my main panel, event
> though I called SetFocus() on my main panel.
>
> While wx.EVT_KEY_DOWN doesn't work, wx.EVT_CHAR does. However, I am
> not clear what exactly is the difference between the two for when I
> just want to test key codes. Is this something I should worry about?
>
> Also, I think I've figured out my last question about frames with a
> group of panels with only one visible panel. I've implemented a
> subclass of frame where panels are added to it with a key, where I've
> attached a demonstration. The frame resizes itself to fit the maximum
> width and height of any panel.
>
> Cheers,
>
> Aaron M.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
More information about the wxpython-users
mailing list