+
+ // flush the logged messages if any
+ wxLog *pLog = wxLog::GetActiveTarget();
+ if ( pLog != NULL && pLog->HasPendingMessages() )
+ pLog->Flush();
+
+ // Send OnIdle events to all windows
+ bool needMore = SendIdleEvents();
+
+ if (needMore)
+ event.RequestMore(TRUE);
+
+ inOnIdle = FALSE;
+}
+
+bool wxApp::SendIdleEvents(void)
+{
+ bool needMore = FALSE;
+ wxNode* node = wxTopLevelWindows.First();
+ while (node)
+ {
+ wxWindow* win = (wxWindow*) node->Data();
+ if (SendIdleEvents(win))
+ needMore = TRUE;
+
+ node = node->Next();
+ }
+ return needMore;
+}
+
+bool wxApp::SendIdleEvents( wxWindow* win )
+{
+ bool needMore = FALSE;
+
+ wxIdleEvent event;
+ event.SetEventObject(win);
+ win->ProcessEvent(event);
+
+ if (event.MoreRequested())
+ needMore = TRUE;
+
+ wxNode* node = win->GetChildren()->First();
+ while (node)
+ {
+ wxWindow* win = (wxWindow*) node->Data();
+ if (SendIdleEvents(win))
+ needMore = TRUE;
+
+ node = node->Next();
+ }
+ return needMore ;
+}