Focus on an non focusable window

Jorgen Bodde jorgen.maillist at gmail.com
Mon Nov 5 02:06:19 PST 2007


Hi Guys,

I'm writing some kind of property sheet and I noticed that tabbing
from a wx.TextCtrl to another wx.TextCtrl (which are the only two
focusable elements on my wx.Frame) leaves a gap in the focusing.

This is what happens;

Focus on wx.TextCtrl  -> TAB
Focus on something invisible -> TAB
Focus on wx.TextCtrl
Focus on something invisible -> TAB
etc.

This is consistent on wxGTK and wxMSW, I did derive a wx.Panel to get
a custom text and better click abilities, but AFAIK a wx.Panel should
not steal the focus.

I read something about a derived method AcceptsFocus and
AcceptsFocusFromKeyboard where you can return False to avoid focussing
but this does not seem to help.

Are there any other elements in wxWidgets that can have focus but have
no input? So far I used only wx.Panel, and a spacer in my sizer, but
nothing else actually.

Regards,
- Jorgen




More information about the wxpython-users mailing list