-bool wxApp::ProcessIdle()
-{
- wxIdleEvent event;
- event.SetEventObject( this );
- ProcessEvent( event );
-
- return event.MoreRequested();
-}
-
-void wxApp::OnIdle( wxIdleEvent &event )
-{
- static bool inOnIdle = FALSE;
-
- /* Avoid recursion (via ProcessEvent default case) */
- if (inOnIdle)
- return;
-
- inOnIdle = TRUE;
-
-#if wxUSE_THREADS
- /* Resend in the main thread events which have been prepared in other
- threads */
- ProcessPendingEvents();
-#endif
-
- /* 'Garbage' collection of windows deleted with Close(). */
- DeletePendingObjects();
-
- /* flush the logged messages if any */
- wxLog *log = wxLog::GetActiveTarget();
- if (log != NULL && log->HasPendingMessages())
- log->Flush();
-
- /* Send OnIdle events to all windows */
- bool needMore = SendIdleEvents();
-
- if (needMore)
- event.RequestMore(TRUE);
-
- inOnIdle = FALSE;
-}
-
-bool wxApp::SendIdleEvents()
-{
- bool needMore = FALSE;
-
- wxWindowList::Node* node = wxTopLevelWindows.GetFirst();
- while (node)
- {
- wxWindow* win = node->GetData();
- if (SendIdleEvents(win))
- needMore = TRUE;
- node = node->GetNext();
- }
-
- return needMore;
-}
-
-bool wxApp::SendIdleEvents( wxWindow* win )