Fwd: [wxPython-users] Skipping widgets in tab traversal?

Eric Ongerth ericongerth at gmail.com
Sat Jun 2 14:12:02 PDT 2007


Oops.

I wrote:

Hmm, so I have certain buttons in a frame that I don't want to be traversed
by the Tab key.

I read that creating a custom button class which overrides
AcceptsFocusFromKeyboard (always returning False in order to do what I want
here) would be necessary.  Also read that this won't work if I derive my
custom NoFocusButton class from wx.Button, because wx.Button isn't
Pythonized to pass the virtual method call thru to the underlying C++.  So I
tried deriving my custom button class from wx.PyButton.   There's no
wx.PyButton as far as I could tell.

So in order to do this I'd have to build a whole custom wx.PyControl for my
desired button class, drawing the button myself, etc, just to get a button
that avoids tab traversal?

I understand I can catch EVT_CHILD_FOCUS in the parent frame and bump the
focus forward... I think i'll try that for now.
Just curious, where might this situation sit on the wxPython release
timeline?

Thanks!

Answering myself:

<ahem> from wx.lib.buttons import GenButton
(etc.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200706=
02/884d6991/attachment.htm


More information about the wxpython-users mailing list