SetFocus() doesn't seem to work in some cases. For example:
[wxTextCtrl] [wxButton]
When the button is clicked, some text is fetched and placed into the
text control. I then want the focus to go to the next text control after
that, but calling its SetFocus() method doesn't do anything at all.
If, in this button handler, I only call the SetFocus() method for the
next control it works correctly.
[wxTextCtrl] [wxButton]
When the button is clicked, some text is fetched and placed into the
text control. I then want the focus to go to the next text control after
that, but calling its SetFocus() method doesn't do anything at all.
IIRC, there is some code executed after a dialog is closed that resets the
focus back to where it was before the dialog was shown. On wxGTK this
probably happens in idle time, which means that it will happen after your
SetFocus. You might be able to get around it by putting a call to wxYield
before your SetFocus. If that doesn't do it then you will have to do the
same trick that wxGTK is doing and change the focus in an EVT_IDLE handler.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
SetFocus() doesn't seem to work in some cases. For example:
[wxTextCtrl] [wxButton]
When the button is clicked, some text is fetched and placed into the
text control. I then want the focus to go to the next text control after
that, but calling its SetFocus() method doesn't do anything at all.
If, in this button handler, I only call the SetFocus() method for the
next control it works correctly.