I wish to traverse all the controls of my panel with the tab key, so I’ve declared
my wx.Panel with style=wx.TAB_TRAVERSAL.
Something strange occurs: with tabs, I can traverse the controls inside the panel,
but after the last control of the panel gets the focus, the focus continue on
the panel’s parent, panel “brothers” and “neffews” !
I wish to traverse all the controls of my panel with the tab key, so I've declared
my wx.Panel with style=wx.TAB_TRAVERSAL.
Something strange occurs: with tabs, I can traverse the controls inside the panel,
but after the last control of the panel gets the focus, the focus continue on
the panel's parent, panel "brothers" and "neffews" !
How can I avoid this problem ?
You can watch for EVT_CHILD_FOCUS events on the parent panel, and if any come from widgets not in the target panel then just call SetFocus on that panel again, (and it will reset it to the first child that can receive the focus.)
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
You don’t need to specify the flab, it’s part of the default style for wx.Panel.
You aren’t totally clear, but I’m getting the impression that you have several panels on a form and tab is travelling through all of them. This is expected behavior. I’ll need more detail on what you want to happen and what is happening to give you any help about changing it.
I wish to traverse all the controls of my panel with the tab key, so I’ve declared
my wx.Panel with style=wx.TAB_TRAVERSAL
.
Something strange occurs: with tabs, I can traverse the controls inside the panel,
but after the last control of the panel gets the focus, the focus continue on
the panel’s parent, panel “brothers” and “neffews” !