- // get the style's colours
- attr.colFg = wxColour(style->fg[state]);
- if (useBase)
- attr.colBg = wxColour(style->base[state]);
- else
- attr.colBg = wxColour(style->bg[state]);
+#ifdef __WXGTK3__
+ GtkStateFlags stateFlag = GTK_STATE_FLAG_NORMAL;
+ if (state)
+ {
+ wxASSERT(state == GTK_STATE_ACTIVE);
+ stateFlag = GTK_STATE_FLAG_ACTIVE;
+ }
+ GtkStyleContext* sc = gtk_widget_get_style_context(widget);
+ GdkRGBA c;
+ gtk_style_context_get_color(sc, stateFlag, &c);
+ attr.colFg = wxColour(c);
+ gtk_style_context_get_background_color(sc, stateFlag, &c);
+ attr.colBg = wxColour(c);
+ wxNativeFontInfo info;
+ info.description = const_cast<PangoFontDescription*>(gtk_style_context_get_font(sc, stateFlag));
+ attr.font = wxFont(info);
+ info.description = NULL;
+#else
+ GtkStyle* style;