]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/app.cpp
fixed linker errors
[wxWidgets.git] / src / gtk / app.cpp
index 3cb777b95939424363166a36bea1388985c4438f..a7b0428703c90edab79b8ac3a52a40e409df7f98 100644 (file)
@@ -76,9 +76,6 @@
 // global data
 //-----------------------------------------------------------------------------
 
-wxApp *wxTheApp = (wxApp *)  NULL;
-wxAppInitializerFunction wxAppBase::m_appInitFn = (wxAppInitializerFunction) NULL;
-
 bool   g_mainThreadLocked = FALSE;
 gint   g_pendingTag = 0;
 
@@ -92,15 +89,6 @@ extern bool g_isIdle;
 
 void wxapp_install_idle_handler();
 
-//-----------------------------------------------------------------------------
-// wxExit
-//-----------------------------------------------------------------------------
-
-void wxExit()
-{
-    gtk_main_quit();
-}
-
 //-----------------------------------------------------------------------------
 // wxYield
 //-----------------------------------------------------------------------------
@@ -168,7 +156,7 @@ bool wxApp::Yield(bool onlyIfNeeded)
 // wxWakeUpIdle
 //-----------------------------------------------------------------------------
 
-void wxWakeUpIdle()
+void wxApp::WakeUpIdle()
 {
 #if wxUSE_THREADS
     if (!wxThread::IsMain())
@@ -361,6 +349,11 @@ static gint wxapp_poll_func( GPollFD *ufds, guint nfds, gint timeout )
 
 void wxapp_install_idle_handler()
 {
+    // GD: this assert is raised when using the thread sample (which works)
+    //     so the test is probably not so easy. Can widget callbacks be
+    //     triggered from child threads and, if so, for which widgets?
+    // wxASSERT_MSG( wxThread::IsMain() || gs_WakeUpIdle, wxT("attempt to install idle handler from widget callback in child thread (should be exclusively from wxWakeUpIdle)") );
+
     wxASSERT_MSG( wxTheApp->m_idleTag == 0, wxT("attempt to install idle handler twice") );
 
     g_isIdle = FALSE;
@@ -650,6 +643,13 @@ int wxApp::MainLoop()
     return 0;
 }
 
+void wxApp::Exit()
+{
+    // VZ: no idea why is it different from ExitMainLoop() but this is what
+    //     wxExit() used to do
+    gtk_main_quit();
+}
+
 void wxApp::ExitMainLoop()
 {
     if (gtk_main_level() > 0)
@@ -793,10 +793,11 @@ int wxEntryStart( int& argc, char *argv[] )
     if (!wxOKlibc()) wxConvCurrent = (wxMBConv*) NULL;
 #endif
 
-    gdk_threads_enter();
-
     gtk_init( &argc, &argv );
 
+    /* we can not enter threads before gtk_init is done */
+    gdk_threads_enter();
+
     wxSetDetectableAutoRepeat( TRUE );
 
     if (!wxApp::Initialize())