Skipping widgets in tab traversal?

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!

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:

from wx.lib.buttons import GenButton
(etc.)