There is quite a bit of documentation of the process that I have read but its not exactly clear about what you ask for and when. What I’m using now is this code:
GdkRGBA normal; GdkRGBA active; GdkRGBA select; GtkStyleContext *style = gtk_widget_get_style_context (wgt); gtk_style_context_get_color (style, GTK_STATE_FLAG_NORMAL, &normal); gtk_style_context_get_color (style, GTK_STATE_FLAG_ACTIVE, &active); gtk_style_context_get_color (style, GTK_STATE_FLAG_SELECTED, &select);
This is running inside the
realise callback of list box control, so in this case
wgt is that listbox. However, the colours returned are all the same shade of near white. I’m using Qogir dark which uses several shades of blue and grey but all I’m getting is a light grey.
I’m trying to draw in a GtkDrawingArea where some things are selected and some are active. I did consider using
gtk_style_context_get_background_color but the documentation makes it clear that shouldn’t be used. So I’m getting nowhere for the moment.