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.
This commit is contained in:
parent
f1dfb27cb1
commit
5e27ff410c
@ -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) )
|
||||
|
Loading…
Reference in New Issue
Block a user