app focus lost when window closes

Peter necedemalis at gmail.com
Tue Oct 2 12:33:27 PDT 2007


Dear wxwidgets mailing list,
I have a window.  I select a menu option which opens a second window.
I click on the second window.  Clicking on the second window is
Connect'ed to a Destroy() method on that second window. (I've also
tried Close(), delete this, etc.) After the second window is
destroyed, focus DOES NOT go to the first window but instead leaves
the app.  I have tried doing firstwindow->SetFocus(),
firstwindow->Show(), firstwindow->Raise() within the Destroy method as
well as a handler catching Destroy events for that second window.  I
do call wxGetApp().SetTopWindow(firstwindow) early on.

I've asked on forums and on #wxwidgets and they've suggested I try the
mailing list and that it might be an obscure bug.  In particular, I
don't select any other programs between the first and second windows.
The app just gives focus up upon the second window closing.   The
second window is created with Create and the first argument is the
first window.  The first window inherits from wxFrame and the second,
I've tried from wxFrame and wxDialog.

I'm using wxGTK 2.8.5 on linux.

Thanks.
     - Peter




More information about the wx-users mailing list