From fb4b0165b22fef2c47e97e90ef5257ca8eadc804 Mon Sep 17 00:00:00 2001 From: Michael Wetherell Date: Tue, 28 Jul 2009 17:48:37 +0000 Subject: [PATCH] Fix SetToolTip(NULL) to unset the tooltip. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61549 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/window.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 99b0125..a397575 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -3763,7 +3763,21 @@ void wxWindowGTK::DoSetToolTip( wxToolTip *tip ) wxWindowBase::DoSetToolTip(tip); if (m_tooltip) + { m_tooltip->GTKApply( (wxWindow *)this ); + } + else + { + GtkWidget *w = GetConnectWidget(); + wxToolTip::GTKApply(w, NULL); +#if GTK_CHECK_VERSION(2, 12, 0) + // Just applying NULL doesn't work on 2.12.0, so also use + // gtk_widget_set_has_tooltip. It is part of the new GtkTooltip API + // but seems also to work with the old GtkTooltips. + if (gtk_check_version(2, 12, 0) == NULL) + gtk_widget_set_has_tooltip(w, FALSE); +#endif + } } void wxWindowGTK::GTKApplyToolTip( GtkTooltips *tips, const gchar *tip ) -- 2.7.4