added wxEventLoop::GetActive()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2001-08-12 22:10:20 +00:00
parent e8e4fa12f2
commit b9f246f7d9
4 changed files with 26 additions and 0 deletions

View File

@@ -62,6 +62,8 @@ private:
// wxEventLoop running and exiting
// ----------------------------------------------------------------------------
wxEventLoop *wxEventLoop::ms_activeLoop = NULL;
wxEventLoop::~wxEventLoop()
{
wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") );
@@ -77,6 +79,9 @@ int wxEventLoop::Run()
// event loops are not recursive, you need to create another loop!
wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") );
wxEventLoop *oldLoop = ms_activeLoop;
ms_activeLoop = this;
m_impl = new wxEventLoopImpl;
gtk_main();
@@ -85,6 +90,8 @@ int wxEventLoop::Run()
delete m_impl;
m_impl = NULL;
ms_activeLoop = oldLoop;
return exitcode;
}