* 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:
Guilhem Lavaux
1999-03-27 18:50:54 +00:00
parent eedcfe5eb9
commit 7214297d16
14 changed files with 223 additions and 5 deletions

View File

@@ -92,6 +92,10 @@ extern char *wxBuffer;
extern char *wxOsVersion;
extern wxList *wxWinHandleList;
extern wxList WXDLLEXPORT wxPendingDelete;
#if wxUSE_THREADS
extern wxList wxPendingEvents;
extern wxCriticalSection wxPendingEventsLocker;
#endif
extern void wxSetKeyboardHook(bool doIt);
extern wxCursor *g_globalCursor;
@@ -893,7 +897,13 @@ int wxApp::MainLoop()
{
}
DoMessage();
// If they are pending events, we must process them.
#if wxUSE_THREADS
ProcessPendingEvents();
#endif
}
return s_currentMsg.wParam;
@@ -909,6 +919,25 @@ bool wxApp::ProcessIdle()
return event.MoreRequested();
}
#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
void wxApp::ExitMainLoop()
{
m_keepGoing = FALSE;