-
- EventRef theEvent;
-
- OSStatus status = ReceiveNextEvent(0, NULL, m_sleepTime, true, &theEvent) ;
-
- switch (status)
- {
- case eventLoopTimedOutErr :
- // process pending wx events before sending idle events
- wxTheApp->ProcessPendingEvents();
- if ( wxTheApp->ProcessIdle() )
- m_sleepTime = kEventDurationNoWait ;
- else
- {
- m_sleepTime = kEventDurationSecond;
-#if wxUSE_THREADS
- wxMutexGuiLeave();
- wxMilliSleep(20);
- wxMutexGuiEnter();
-#endif
- }
- break;
-
- case eventLoopQuitErr :
- // according to QA1061 this may also occur
- // when a WakeUp Process is executed
- break;
-
- default:
- DispatchAndReleaseEvent(theEvent);
- m_sleepTime = kEventDurationNoWait ;
- break;
- }
-
- return true;
-}
-
-int wxGUIEventLoop::DispatchTimeout(unsigned long timeout)
-{