]> git.saurik.com Git - wxWidgets.git/blobdiff - src/x11/evtloop.cpp
Fixed wxRichTextCtrl base class
[wxWidgets.git] / src / x11 / evtloop.cpp
index eab9042841002696f901b3471fe326e8d5b77c4e..bfcf4917afa6d0f7e7c43dfe25b88a0ab72c240d 100644 (file)
@@ -243,3 +243,33 @@ bool wxGUIEventLoop::Dispatch()
     (void) m_impl->ProcessEvent( &event );
     return true;
 }
+
+bool wxGUIEventLoop::YieldFor(long eventsToProcess)
+{
+    // Sometimes only 2 yields seem
+    // to do the trick, e.g. in the
+    // progress dialog
+    int i;
+    for (i = 0; i < 2; i++)
+    {
+        m_isInsideYield = true;
+        m_eventsToProcessInsideYield = eventsToProcess;
+
+        // Call dispatch at least once so that sockets
+        // can be tested
+        wxTheApp->Dispatch();
+
+        // TODO: implement event filtering using the eventsToProcess mask
+        while (wxTheApp && wxTheApp->Pending())
+            wxTheApp->Dispatch();
+
+#if wxUSE_TIMER
+        wxGenericTimerImpl::NotifyTimers();
+#endif
+        ProcessIdle();
+
+        m_isInsideYield = false;
+    }
+
+    return true;
+}