From 5e27ff410c5b1197fdd1c4f02adb00605bea52d1 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 16 Dec 2017 09:42:39 -0800 Subject: [PATCH] Fix building wxToolTip with GTK+4 gtk_settings_set_long_property() is no longer available. The properties "gtk-enable-tooltips" and "gtk-tooltip-timeout" are ignored since GTK+ 3.10, so just don't compile that code with GTK+4. --- src/gtk/tooltip.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/gtk/tooltip.cpp b/src/gtk/tooltip.cpp index 74091057a8..df78390d10 100644 --- a/src/gtk/tooltip.cpp +++ b/src/gtk/tooltip.cpp @@ -73,12 +73,17 @@ void wxToolTip::GTKApply(GtkWidget* widget, const char* tip) void wxToolTip::Enable( bool flag ) { +#ifdef __WXGTK4__ + wxUnusedVar(flag); +#else #if GTK_CHECK_VERSION(2, 12, 0) if (wx_is_at_least_gtk2(12)) { GtkSettings* settings = gtk_settings_get_default(); + wxGCC_WARNING_SUPPRESS(deprecated-declarations) if (settings) gtk_settings_set_long_property(settings, "gtk-enable-tooltips", flag, NULL); + wxGCC_WARNING_RESTORE() } else #endif @@ -93,16 +98,22 @@ void wxToolTip::Enable( bool flag ) gtk_tooltips_disable( gs_tooltips ); #endif } +#endif // !__WXGTK4__ } void wxToolTip::SetDelay( long msecs ) { +#ifdef __WXGTK4__ + wxUnusedVar(msecs); +#else #if GTK_CHECK_VERSION(2, 12, 0) if (wx_is_at_least_gtk2(12)) { GtkSettings* settings = gtk_settings_get_default(); + wxGCC_WARNING_SUPPRESS(deprecated-declarations) if (settings) gtk_settings_set_long_property(settings, "gtk-tooltip-timeout", msecs, NULL); + wxGCC_WARNING_RESTORE() } else #endif @@ -114,6 +125,7 @@ void wxToolTip::SetDelay( long msecs ) gtk_tooltips_set_delay( gs_tooltips, (int)msecs ); #endif } +#endif // !__WXGTK4__ } void wxToolTip::SetAutoPop( long WXUNUSED(msecs) )