]> git.saurik.com Git - wxWidgets.git/commitdiff
When setting empty string as a tooltip, call gtk_widget_set_has_tooltip() with FALSE...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Thu, 23 Sep 2010 12:55:22 +0000 (12:55 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Thu, 23 Sep 2010 12:55:22 +0000 (12:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp

index 86eb2c026dad29e5a9ef377cc32306626f13787b..fa02dbc397e8e835b669d1dfc837f3e07b910289 100644 (file)
@@ -3794,7 +3794,18 @@ void wxWindowGTK::DoSetToolTip( wxToolTip *tip )
 
 void wxWindowGTK::GTKApplyToolTip( GtkTooltips *tips, const gchar *tip )
 {
-    gtk_tooltips_set_tip(tips, GetConnectWidget(), tip, NULL);
+    GtkWidget *w = GetConnectWidget();
+    gtk_tooltips_set_tip(tips, w, tip, NULL);
+
+#if GTK_CHECK_VERSION(2, 12, 0)
+    if ( !tip || tip[0] == '\0' )
+    {
+        // Just applying empty tool tip doesn't work on 2.12.0, so also use
+        // gtk_widget_set_has_tooltip.
+        if (gtk_check_version(2, 12, 0) == NULL)
+            gtk_widget_set_has_tooltip(w, FALSE);
+    }
+#endif
 }
 #endif // wxUSE_TOOLTIPS