Fixed helpview sample and app in binary compatible way by only exiting

on idle (would exit prematurely since help frame doesn't prevent app exit
when still open)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-03-05 10:46:54 +00:00
parent c5effe4953
commit 658ba84dc9
3 changed files with 45 additions and 2 deletions

View File

@@ -42,11 +42,16 @@ protected:
IMPLEMENT_APP(hvApp)
BEGIN_EVENT_TABLE(hvApp, wxApp)
EVT_IDLE(hvApp::OnIdle)
END_EVENT_TABLE()
hvApp::hvApp()
{
#if wxUSE_IPC
m_server = NULL;
#endif
m_exitIfNoMainWindow = false;
}
bool hvApp::OnInit()
@@ -55,6 +60,11 @@ bool hvApp::OnInit()
delete wxLog::SetActiveTarget(new wxLogStderr); // So dialog boxes aren't used
#endif
// Don't exit on frame deletion, since the help window is programmed
// to cause the app to exit even if it is still open. We need to have the app
// close by other means.
SetExitOnFrameDelete(false);
wxArtProvider::Push(new AlternateArtProvider);
#ifdef __WXMAC__
@@ -218,10 +228,17 @@ bool hvApp::OnInit()
#endif
m_helpController->DisplayContents();
SetTopWindow(m_helpController->GetFrame());
m_exitIfNoMainWindow = true;
return true;
}
void hvApp::OnIdle(wxIdleEvent& event)
{
if (m_exitIfNoMainWindow && !GetTopWindow())
ExitMainLoop();
}
int hvApp::OnExit()
{