added wxLog::Suspend/Resume and wxYield() uses them now so that it won't flush

the messages any more


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-22 10:00:29 +00:00
parent 6daa30a07e
commit 2ed3265e18
5 changed files with 45 additions and 15 deletions

View File

@@ -99,10 +99,18 @@ bool wxYield()
wxTheApp->m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL );
}
// disable log flushing from here because a call to wxYield() shouldn't
// normally result in message boxes popping up &c
wxLog::Suspend();
/* it's necessary to call ProcessIdle() to update the frames sizes which
might have been changed (it also will update other things set from
OnUpdateUI() which is a nice (and desired) side effect) */
while (wxTheApp->ProcessIdle()) { }
while (wxTheApp->ProcessIdle())
;
// let the logs be flashed again
wxLog::Resume();
return TRUE;
}
@@ -380,9 +388,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
/* flush the logged messages if any */
#if wxUSE_LOG
wxLog *log = wxLog::GetActiveTarget();
if (log != NULL && log->HasPendingMessages())
log->Flush();
wxLog::FlushActive();
#endif // wxUSE_LOG
}