Change window focus

Hi,
i have a splitter window with a tree on the left side and a notebook with a wxSTC on the right.
Once double clicked on a tree element I add some text to the stc editor. The problem is that i would also like to restore the focus
on the stc text editor.
I've tried with SetFocus, but nothing appens..

P.S. Another question.. is possible to disable the focus between windows using the SHIFT+TAB keys?

thanks

Alessandro Crugnola [aka] sephiroth
Flash | PHP Developer
http://www.sephiroth.it

Team Macromedia Volunteer for Flash
http://www.macromedia.com/go/team

Alessandro Crugnola *sephiroth* wrote:

Hi,
i have a splitter window with a tree on the left side and a notebook with a wxSTC on the right.
Once double clicked on a tree element I add some text to the stc editor. The problem is that i would also like to restore the focus
on the stc text editor.
I've tried with SetFocus, but nothing appens..

Try using wxCallAfter(stcWindow.SetFocus) so it will happen a little later. It may be the case that the tree control is resetting focus to itself as part of the default handling for the click events.

P.S. Another question.. is possible to disable the focus between windows using the SHIFT+TAB keys?

Maybe, but I'll need more info about your app to suggest anything. Do you have any other windows involved besides the tree, stc, splitter and frame?

···

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

:: > P.S. Another question.. is possible to disable the focus
:: between windows using the SHIFT+TAB keys?
::
:: Maybe, but I'll need more info about your app to suggest
:: anything. Do you have any other windows involved besides
:: the tree, stc, splitter and frame?

Yes, you're right.
I have the main frame divided into 2 window with a wxSplitter.
on the left side there's a notebook with some pages and into each page a tree ctrl.

on the right side another notebook with in each page a wxSTC editor.

Now the problem is that when I select part of text into the stc editor and press SHIFT+TAB, i assumed the text indent will be
reduced, but instead the focus changes from the stc editor to the left notebook page.
This won't happen if I close the left window dragging the wxSplitter.. but i would like that the SHIFT+TAB won't change the focused
window, but only work on the text indentation.

Thanks again

Alessandro Crugnola *sephiroth* wrote:

:: > P.S. Another question.. is possible to disable the focus ::
between windows using the SHIFT+TAB keys? :: :: Maybe, but I'll need
more info about your app to suggest :: anything. Do you have any
other windows involved besides :: the tree, stc, splitter and frame?

Yes, you're right. I have the main frame divided into 2 window with a
wxSplitter. on the left side there's a notebook with some pages and
into each page a tree ctrl.

on the right side another notebook with in each page a wxSTC editor.

Now the problem is that when I select part of text into the stc
editor and press SHIFT+TAB, i assumed the text indent will be reduced, but instead the focus changes from the stc editor to the
left notebook page. This won't happen if I close the left window
dragging the wxSplitter.. but i would like that the SHIFT+TAB won't
change the focused window, but only work on the text indentation.

Okay, this is an old bug. The Shift-Tab is not generating key events, but is unconditionally being used for navigation.

https://sourceforge.net/tracker/?group_id=9863&atid=109863&func=detail&aid=690274

···

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