From 27bb67355a58cef4dd37a9b18fefba93260cacf3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Aug 2015 15:18:14 +0200 Subject: [PATCH] Avoid deprecation warnings for gtk_widget_modify_bg() in wxGTK3. We still need to use this function as its replacement is itself deprecated in GTK+ 3.16, so just suppress the warnings for now. Closes #17084. --- src/aui/framemanager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index ccf8c32e64..4006676154 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -266,11 +266,20 @@ public: g_signal_connect( m_widget, "realize", G_CALLBACK (gtk_pseudo_window_realized_callback), this ); + // gtk_widget_modify_bg() is deprecated in 3.0 but doesn't seem to have + // any obvious replacement as gtk_widget_override_background_color() + // mentioned in the deprecation message it is itself deprecated in + // 3.16, so just continue using it for now. In longer term the best + // would probably be to catch "draw" signal and paint the background + // ourselves. GdkColor col; col.red = 128 * 256; col.green = 192 * 256; col.blue = 255 * 256; + + wxGCC_WARNING_SUPPRESS(deprecated-declarations) gtk_widget_modify_bg( m_widget, GTK_STATE_NORMAL, &col ); + wxGCC_WARNING_RESTORE(deprecated-declarations) } bool SetTransparent(wxByte WXUNUSED(alpha)) wxOVERRIDE