From ffdde8753630ab8d8129035f3aa6c99987c2465c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 24 Nov 2013 18:07:20 +0000 Subject: [PATCH] avoid deprecated gtk_style_context_get_font(), closes #15697 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@75284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/control.cpp | 4 ++-- src/gtk/settings.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index b63b370645..c2633772fe 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -254,9 +254,9 @@ wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget, gtk_style_context_get_background_color(sc, stateFlag, &c); attr.colBg = wxColour(c); wxNativeFontInfo info; - info.description = const_cast(gtk_style_context_get_font(sc, stateFlag)); + gtk_style_context_get( + sc, stateFlag, GTK_STYLE_PROPERTY_FONT, &info.description, NULL); attr.font = wxFont(info); - info.description = NULL; #else GtkStyle* style; diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 89353c0b5c..98efe96766 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -428,8 +428,8 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) wxNativeFontInfo info; #ifdef __WXGTK3__ GtkStyleContext* sc = gtk_widget_get_style_context(ButtonWidget()); - info.description = const_cast( - gtk_style_context_get_font(sc, GTK_STATE_FLAG_NORMAL)); + gtk_style_context_get(sc, GTK_STATE_FLAG_NORMAL, + GTK_STYLE_PROPERTY_FONT, &info.description, NULL); #else info.description = ButtonStyle()->font_desc; #endif @@ -440,10 +440,14 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) // it's "Sans Serif" but the real font is called "Sans"): if (!wxFontEnumerator::IsValidFacename(gs_fontSystem.GetFaceName()) && gs_fontSystem.GetFaceName() == "Sans Serif") + { gs_fontSystem.SetFaceName("Sans"); + } #endif // wxUSE_FONTENUM +#ifndef __WXGTK3__ info.description = NULL; +#endif } font = gs_fontSystem; break;