Re: gtk-app-devel-list Digest, Vol 156, Issue 16
- From: Richard Shann <richard rshann plus com>
- To: gtk-app-devel-list gnome org
- Subject: Re: gtk-app-devel-list Digest, Vol 156, Issue 16
- Date: Sat, 22 Apr 2017 14:03:13 +0100
Date: Fri, 21 Apr 2017 09:01:54 +0000
From: R?ben Rodrigues <ruben_gr live com pt>
To: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
Subject: CheckButton background color
Message-ID:
<AM5PR0801MB1891BAFC8348EED3CFFAB1E7AD1A0 AM5PR0801MB1891 eurprd08 prod outlook com>
Content-Type: text/plain; charset="utf-8"
Hi,
Someone knows how to change gtkcheckbutton background and size in CSS?
The GNU Denemo program uses this function that changes the background
color of a widget:
void set_background_color(GtkWidget *w, gchar *color)
{
GtkCssProvider *gcp;
GtkStyleContext *gsc;
gsc = gtk_widget_get_style_context(w);
const gchar *type = g_type_name (G_TYPE_FROM_INSTANCE (w));
gchar *str = g_strdup_printf ("%s {background-color: %s;}", type,
color);
gcp= gtk_css_provider_new();
gtk_css_provider_load_from_data(gcp, str, -1, 0);
g_free (str);
gtk_style_context_add_provider(gsc, GTK_STYLE_PROVIDER(gcp),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
HTH
Richard Shann
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]