X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/53a2db124c633f80bdb16336084262037d879a2c..88b987876d4e8d18580f8dd1705b7471aa91388b:/include/wx/evtloop.h diff --git a/include/wx/evtloop.h b/include/wx/evtloop.h index 6a573d713c..0be2ab6dc7 100644 --- a/include/wx/evtloop.h +++ b/include/wx/evtloop.h @@ -116,7 +116,7 @@ protected: #elif defined(__WXMSW__) #include "wx/msw/evtloop.h" #elif defined(__WXMAC__) - #include "wx/mac/evtloop.h" + #include "wx/osx/evtloop.h" #elif defined(__WXDFB__) #include "wx/dfb/evtloop.h" #else // other platform @@ -223,4 +223,30 @@ private: wxEventLoopBase *m_evtLoopOld; }; +class wxEventLoopGuarantor +{ +public: + wxEventLoopGuarantor() + { + m_evtLoopNew = NULL; + if (!wxEventLoop::GetActive()) + { + m_evtLoopNew = new wxEventLoop; + wxEventLoop::SetActive(m_evtLoopNew); + } + } + + ~wxEventLoopGuarantor() + { + if (m_evtLoopNew) + { + wxEventLoop::SetActive(NULL); + delete m_evtLoopNew; + } + } + +private: + wxEventLoop *m_evtLoopNew; +}; + #endif // _WX_EVTLOOP_H_