* Added threads event propagation. Should compile on GTK (tested).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -49,6 +49,10 @@
|
||||
|
||||
extern char *wxBuffer;
|
||||
extern wxList wxPendingDelete;
|
||||
#if wxUSE_THREADS
|
||||
extern wxList wxPendingEvents;
|
||||
extern wxList wxPendingEventsLocker;
|
||||
#endif
|
||||
|
||||
wxApp *wxTheApp = NULL;
|
||||
|
||||
@@ -411,6 +415,11 @@ void wxApp::OnIdle(wxIdleEvent& event)
|
||||
// 'Garbage' collection of windows deleted with Close().
|
||||
DeletePendingObjects();
|
||||
|
||||
#if wxUSE_THREADS
|
||||
// Flush pending events.
|
||||
ProcessPendingEvents();
|
||||
#endif
|
||||
|
||||
// flush the logged messages if any
|
||||
wxLog *pLog = wxLog::GetActiveTarget();
|
||||
if ( pLog != NULL && pLog->HasPendingMessages() )
|
||||
@@ -483,6 +492,24 @@ void wxApp::DeletePendingObjects()
|
||||
}
|
||||
}
|
||||
|
||||
#if wxUSE_THREADS
|
||||
void wxApp::ProcessPendingEvents()
|
||||
|
||||
wxNode *node = wxPendingEvents.First();
|
||||
wxCriticalSectionLocker locker(wxPendingEventsLocker);
|
||||
|
||||
while (node)
|
||||
{
|
||||
wxEvtHandler *handler = (wxEvtHandler *)node->Data();
|
||||
|
||||
handler->ProcessPendingEvents();
|
||||
|
||||
delete node;
|
||||
node = wxPendingEvents.First();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
wxLog* wxApp::CreateLogTarget()
|
||||
{
|
||||
return new wxLogGui;
|
||||
|
Reference in New Issue
Block a user