[wxPython] WxSplitterWindow: Changing keyboard focus

Hi all,
I have a WxSplitterWindow, with two panes, each containing a wxGrid.

On Ctrl-Tab, I want the keyboard focus to change to the other pane.

I've been wading through the code, and while I can figure out how to
catch the event, I can't seem to figure out how to change the focus.

TIA!

-- Patricia

On Ctrl-Tab, I want the keyboard focus to change to the other pane.

I've been wading through the code, and while I can figure out how to
catch the event, I can't seem to figure out how to change the focus.

    window.SetFocus() ??

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

On Ctrl-Tab, I want the keyboard focus to change to the other pane.

I've been wading through the code, and while I can figure out how to
catch the event, I can't seem to figure out how to change the focus.

    window.SetFocus() ??

But how do I figure out which pane has the focus, so I can switch it
to the other one?

>>
>> On Ctrl-Tab, I want the keyboard focus to change to the other pane.
>>
>> I've been wading through the code, and while I can figure out how to
>> catch the event, I can't seem to figure out how to change the focus.
>>
> window.SetFocus() ??

But how do I figure out which pane has the focus, so I can switch it
to the other one?

Ah, I see... This might work: Use wxWindow_FindFocus() to get the current
window with the focus, and then loop using window.GetParent() until either
one of your pane windows or None is returned.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!

Another possibility is to take

    current = wxWindow_FindFocus()

and compare

current.GetId() == first_pane.GetId()

I seem to remember running into some trouble doing this
if the window with the focus wasn't a wxWindow, but
depending on how you are catching the event, you may be
able to limit the test from occuring when that isn't a case,
but I don't remember the details.

David

PS
Hi, Patricia

···

wxpython-users@lists.wxwindows.org wrote:

>
> >>
> >> On Ctrl-Tab, I want the keyboard focus to change to the other pane.
> >>
> >> I've been wading through the code, and while I can figure out how to
> >> catch the event, I can't seem to figure out how to change the focus.
> >>
> > Â Â window.SetFocus() Â ??
>
> But how do I figure out which pane has the focus, so I can switch it
> to the other one?
>

Ah, I see... Â This might work: Â Use wxWindow_FindFocus() to get the current
window with the focus, and then loop using window.GetParent() until either
one of your pane windows or None is returned.

__________________________________________________________________
Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/