]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/app.cpp
Corrected/added support for column headers with icon and text
[wxWidgets.git] / src / gtk / app.cpp
index a8671dbf3dd391c41741ce886262d3fe92ab4e41..c4315c64e6c3c74f2b3b548e29abb8ec6d5a5cb6 100644 (file)
@@ -48,8 +48,6 @@
 // global data
 //-----------------------------------------------------------------------------
 
-bool   g_mainThreadLocked = false;
-
 static GtkWidget *gs_RootWindow = (GtkWidget*) NULL;
 
 //-----------------------------------------------------------------------------
@@ -206,6 +204,11 @@ bool wxApp::DoIdle()
         g_source_remove(m_idleSourceId);
         m_idleSourceId = 0;
     }
+
+    // Pending events can be added asynchronously,
+    // need to keep idle source if any have appeared
+    needMore = needMore || HasPendingEvents();
+
     // if more idle processing requested
     if (needMore)
     {
@@ -218,25 +221,6 @@ bool wxApp::DoIdle()
     return false;
 }
 
-#if wxUSE_THREADS
-
-static GPollFunc wxgs_poll_func;
-
-extern "C" {
-static gint wxapp_poll_func( GPollFD *ufds, guint nfds, gint timeout )
-{
-    g_mainThreadLocked = true;
-
-    gint res = (*wxgs_poll_func)(ufds, nfds, timeout);
-
-    g_mainThreadLocked = false;
-
-    return res;
-}
-}
-
-#endif // wxUSE_THREADS
-
 //-----------------------------------------------------------------------------
 // Access to the root window global
 //-----------------------------------------------------------------------------
@@ -272,6 +256,30 @@ wxApp::~wxApp()
 {
 }
 
+bool wxApp::SetNativeTheme(const wxString& theme)
+{
+    wxString path;
+    path = gtk_rc_get_theme_dir();
+    path += "/";
+    path += theme.utf8_str();
+    path += "/gtk-2.0/gtkrc";
+
+    if ( wxFileExists(path.utf8_str()) )
+        gtk_rc_add_default_file(path.utf8_str());
+    else if ( wxFileExists(theme.utf8_str()) )
+        gtk_rc_add_default_file(theme.utf8_str());
+    else
+    {
+        wxLogWarning("Theme \"%s\" not available.", theme);
+
+        return false;
+    }
+
+    gtk_rc_reparse_all_for_settings(gtk_settings_get_default(), TRUE);
+
+    return true;
+}
+
 bool wxApp::OnInitGui()
 {
     if ( !wxAppBase::OnInitGui() )
@@ -354,9 +362,6 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_)
         g_thread_init(NULL);
         gdk_threads_init();
     }
-
-    wxgs_poll_func = g_main_context_get_poll_func(NULL);
-    g_main_context_set_poll_func(NULL, wxapp_poll_func);
 #endif // wxUSE_THREADS
 
     // We should have the wxUSE_WCHAR_T test on the _outside_
@@ -437,6 +442,7 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_)
         }
 
         argc_ = argcGTK;
+        argv_[argc_] = NULL;
     }
     //else: gtk_init() didn't modify our parameters