]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/app.cpp
EVT_TEXT_UPDATED bug fixed, text ctrl callbacks simplified
[wxWidgets.git] / src / gtk / app.cpp
index afe49ce3c1552d12142a6abbfc9c7efffb2f421a..93459c373dd053f08384a0e8cb5d2e4e48f3b8a0 100644 (file)
@@ -46,6 +46,10 @@ wxApp *wxTheApp = (wxApp *)  NULL;
 wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
 
 extern wxList wxPendingDelete;
 wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
 
 extern wxList wxPendingDelete;
+#if wxUSE_THREADS
+extern wxList wxPendingEvents;
+extern wxCriticalSection wxPendingEventsLocker;
+#endif
 extern wxResourceCache *wxTheResourceCache;
 
 unsigned char g_palette[64*3] =
 extern wxResourceCache *wxTheResourceCache;
 
 unsigned char g_palette[64*3] =
@@ -283,6 +287,10 @@ void wxApp::OnIdle( wxIdleEvent &event )
 
     inOnIdle = TRUE;
 
 
     inOnIdle = TRUE;
 
+    /* Resend in the main thread events which have been prepared in other
+       threads */
+    ProcessPendingEvents();
+
     /* 'Garbage' collection of windows deleted with Close(). */
     DeletePendingObjects();
 
     /* 'Garbage' collection of windows deleted with Close(). */
     DeletePendingObjects();
 
@@ -366,6 +374,25 @@ void wxApp::Dispatch()
 {
 }
 
 {
 }
 
+#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::DeletePendingObjects()
 {
     wxNode *node = wxPendingDelete.First();
 void wxApp::DeletePendingObjects()
 {
     wxNode *node = wxPendingDelete.First();