adding OnLaunched

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2013-07-23 17:57:05 +00:00
parent 3988b3e819
commit b8f0ac88a5
2 changed files with 14 additions and 0 deletions

View File

@@ -103,6 +103,9 @@ public:
// be done here. When OnRun() returns, the programs starts shutting down. // be done here. When OnRun() returns, the programs starts shutting down.
virtual int OnRun(); virtual int OnRun();
// Called before the first events are handled, called from within MainLoop()
virtual void OnLaunched();
// This is called by wxEventLoopBase::SetActive(): you should put the code // This is called by wxEventLoopBase::SetActive(): you should put the code
// which needs an active event loop here. // which needs an active event loop here.
// Note that this function is called whenever an event loop is activated; // Note that this function is called whenever an event loop is activated;

View File

@@ -256,6 +256,10 @@ int wxAppConsoleBase::OnRun()
return MainLoop(); return MainLoop();
} }
void wxAppConsoleBase::OnLaunched()
{
}
int wxAppConsoleBase::OnExit() int wxAppConsoleBase::OnExit()
{ {
#if wxUSE_CONFIG #if wxUSE_CONFIG
@@ -321,6 +325,13 @@ int wxAppConsoleBase::MainLoop()
{ {
wxEventLoopBaseTiedPtr mainLoop(&m_mainLoop, CreateMainLoop()); wxEventLoopBaseTiedPtr mainLoop(&m_mainLoop, CreateMainLoop());
#if defined(__WXOSX__) && wxOSX_USE_COCOA_OR_IPHONE
// OnLaunched called from native app controller
#else
if (wxTheApp)
wxTheApp->OnLaunched();
#endif
return m_mainLoop ? m_mainLoop->Run() : -1; return m_mainLoop ? m_mainLoop->Run() : -1;
} }