Switch to GtkTooltip from deprecated GtkTooltips in wxGTK wxToolTip.
Don't use deprecated GtkTooltips in wxGTK code any more, use the new GtkTooltip instead. Closes #12034. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3782,30 +3782,23 @@ void wxWindowGTK::DoSetToolTip( wxToolTip *tip )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
GtkWidget *w = GetConnectWidget();
|
||||
gtk_tooltips_set_tip(tips, w, tip, NULL);
|
||||
|
||||
#if GTK_CHECK_VERSION(2, 12, 0)
|
||||
if ( !tip || tip[0] == '\0' )
|
||||
if (!gtk_check_version(2, 12, 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);
|
||||
gtk_widget_set_tooltip_text (w, tip);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
gtk_tooltips_set_tip(tips, w, tip, NULL);
|
||||
}
|
||||
}
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
|
Reference in New Issue
Block a user