-// Yield to other processes
-
-bool wxApp::Yield(bool onlyIfNeeded)
-{
- // Sometimes only 2 yields seem
- // to do the trick, e.g. in the
- // progress dialog
- int i;
- for (i = 0; i < 2; i++)
- {
- static bool s_inYield = false;
-
- if ( s_inYield )
- {
- if ( !onlyIfNeeded )
- {
- wxFAIL_MSG( wxT("wxYield called recursively" ) );
- }
-
- return false;
- }
-
- s_inYield = true;
-
- // Make sure we have an event loop object,
- // or Pending/Dispatch will fail
- wxEventLoop* eventLoop = wxEventLoop::GetActive();
- wxEventLoop* newEventLoop = NULL;
- if (!eventLoop)
- {
- newEventLoop = new wxEventLoop;
- wxEventLoop::SetActive(newEventLoop);
- }
-
- // Call dispatch at least once so that sockets
- // can be tested
- wxTheApp->Dispatch();
-
- while (wxTheApp && wxTheApp->Pending())
- wxTheApp->Dispatch();
-
-#if wxUSE_TIMER
- wxTimer::NotifyTimers();
-#endif
- ProcessIdle();
-
- if (newEventLoop)
- {
- wxEventLoop::SetActive(NULL);
- delete newEventLoop;
- }
-
- s_inYield = false;
- }
-
- return true;
-}
-
-#ifdef __WXDEBUG__
-
-void wxApp::OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg)
-{
- // While the GUI isn't working that well, just print out the
- // message.
-#if 1
- wxAppBase::OnAssert(file, line, cond, msg);
-#else
- wxString msg2;
- msg2.Printf("At file %s:%d: %s", file, line, msg);
- wxLogDebug(msg2);
-#endif
-}
-
-#endif // __WXDEBUG__