]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix compilation with GTK+ 2.4.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 28 Feb 2010 11:08:59 +0000 (11:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 28 Feb 2010 11:08:59 +0000 (11:08 +0000)
Support for ellipsization in GtkTreeView and gtk_window_set_focus_on_map() are
new in 2.6, don't use them with 2.4.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dataview.cpp
src/gtk/toplevel.cpp

index 9e316bb2687a336286504ffc0d8d42a30ddb40ff..02423c65eb32e6907df798133878a1e0bc2b1345 100644 (file)
@@ -1695,6 +1695,7 @@ int wxDataViewRenderer::GetAlignment() const
 
 void wxDataViewRenderer::EnableEllipsize(wxEllipsizeMode mode)
 {
+#ifdef __WXGTK26__
     if ( gtk_check_version(2, 6, 0) != NULL )
         return;
 
@@ -1709,10 +1710,14 @@ void wxDataViewRenderer::EnableEllipsize(wxEllipsizeMode mode)
     g_value_set_enum( &gvalue, static_cast<PangoEllipsizeMode>(mode) );
     g_object_set_property( G_OBJECT(rend), "ellipsize", &gvalue );
     g_value_unset( &gvalue );
+#else // GTK < 2.6
+    wxUnusedVar(mode);
+#endif // GTK 2.6/before
 }
 
 wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const
 {
+#ifdef __WXGTK26__
     if ( gtk_check_version(2, 6, 0) != NULL )
         return wxELLIPSIZE_NONE;
 
@@ -1728,6 +1733,9 @@ wxEllipsizeMode wxDataViewRenderer::GetEllipsizeMode() const
     g_value_unset( &gvalue );
 
     return mode;
+#else // GTK < 2.6
+    return wxELLIPSIZE_NONE;
+#endif // GTK 2.6/before
 }
 
 void
index 2e2bccb0458cc7c38ec04980791c61f14b6576b6..d0f1b1e59d83590524fd54c04b13906f5aeb799a 100644 (file)
@@ -358,8 +358,15 @@ gtk_frame_map_callback( GtkWidget*,
         eventShow.SetEventObject(win);
         win->GetEventHandler()->ProcessEvent(eventShow);
     }
-    // restore focus-on-map setting in case ShowWithoutActivating() was called
-    gtk_window_set_focus_on_map(GTK_WINDOW(win->m_widget), true);
+
+#if GTK_CHECK_VERSION(2,6,0)
+    if (!gtk_check_version(2,6,0))
+    {
+        // restore focus-on-map setting in case ShowWithoutActivating() was called
+        gtk_window_set_focus_on_map(GTK_WINDOW(win->m_widget), true);
+    }
+#endif // GTK+ 2.6+
+
     return false;
 }
 }
@@ -897,7 +904,11 @@ void wxTopLevelWindowGTK::ShowWithoutActivating()
 {
     if (!m_isShown)
     {
-        gtk_window_set_focus_on_map(GTK_WINDOW(m_widget), false);
+#if GTK_CHECK_VERSION(2,6,0)
+        if (!gtk_check_version(2,6,0))
+            gtk_window_set_focus_on_map(GTK_WINDOW(m_widget), false);
+#endif // GTK+ 2.6+
+
         Show(true);
     }
 }