]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/evtloop.mm
Added a proper log frame to the propgrid sample
[wxWidgets.git] / src / osx / cocoa / evtloop.mm
index 795a05f9b762fb54e48bd79d16a180644e722052..4798214f02d40d2e565fe441f8cc81d893ae7f3f 100644 (file)
@@ -87,6 +87,16 @@ void wxGUIEventLoop::WakeUp()
     wxMacWakeUp();
 }
 
+CFRunLoopRef wxGUIEventLoop::CFGetCurrentRunLoop() const
+{
+    NSRunLoop* nsloop = [NSRunLoop currentRunLoop];
+    return [nsloop getCFRunLoop];
+}
+
+//-----------------------------------------------------------------------------
+// events dispatch and loop handling
+//-----------------------------------------------------------------------------
+
 bool wxGUIEventLoop::Pending() const
 {
     wxMacAutoreleasePool autoreleasepool;
@@ -116,6 +126,9 @@ bool wxGUIEventLoop::Dispatch()
     }
     else
     {
+        if (wxTheApp)
+            wxTheApp->ProcessPendingEvents();
+        
         if ( wxTheApp->ProcessIdle() )
             m_sleepTime = 0.0 ;
         else
@@ -161,6 +174,10 @@ bool wxGUIEventLoop::YieldFor(long eventsToProcess)
     // OnUpdateUI() which is a nice (and desired) side effect)
     while ( ProcessIdle() ) {}
 
+    // if there are pending events, we must process them.
+    if (wxTheApp)
+        wxTheApp->ProcessPendingEvents();
+
 #if wxUSE_LOG
     wxLog::Resume();
 #endif // wxUSE_LOG