Catching key events from a panel (and follow-up to stacked panels)
Aaron MacDonald
ajmacd at ns.sympatico.ca
Fri Feb 1 13:35:51 PST 2008
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stackpanel.py
Type: text/x-python-script
Size: 3155 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20080201/c72d86de/stackpanel.bin
-------------- next part --------------
More information about the wxpython-users
mailing list