Ensure that wxApp::Yield is always processing pending event by creating a

temporary event loop if needed.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2008-05-16 15:21:40 +00:00
parent 390d9ef3a8
commit 3cf88bbd74
8 changed files with 40 additions and 20 deletions

View File

@@ -198,4 +198,32 @@ private:
wxEventLoop *m_evtLoopOld;
};
#if wxABI_VERSION >= 20808
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 // wxABI_VERSION >= 20805
#endif // _WX_EVTLOOP_H_