]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/evtloop.h
fixed printing preview to not report errors in infinite loop (bug introduced by r54133)
[wxWidgets.git] / include / wx / evtloop.h
index 6a573d713c8bc23f45cb09091a07639974145bea..0be2ab6dc79feef34770063954e638c6e6c7fd7b 100644 (file)
@@ -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_