wxFrame.Close() when debug message frame exi sts

Schoenborn, Oliver wrote:
> Hi, I've implemented File->Quit in my application, it calls self.Close()
> (self being the frame). I start my app with a wxApp(1) so that I get an
> output window containing the result of all my print statements. If this
> output window is not closed, when I close the main app frame the app

doesn't

> exit. So:
>
> Is there a way of making the app close the output window (automatically
> created by wxApp) when the main frame gets closed?

If you call app.SetTopWindow(frame) with your main frame then when the
output window is first created the frame will be made its parent and it
shoudl be closed when the main frame is.

That's what I thought too but it doesn't work. Could it be because the stdio
window gets created during the main frame construction (there are some print
statements in there)? But the call to app.SetTopWindow() is after so it
should work. I even tried app.SetExitOnFrameDelete().

If that doesn't work then in
your EVT_CLOSE handler you can get at it with wxGetApp().stdioWin and
close it yourself.

That's the info I was looking for. It is not in the wxWidgets documentation
AFAICT. One remark: closing it requires stdioWin.close(), shouldn't it be
Close(), just to be consistent with wxWidgets?

Thanks,

Oliver