Re: gtk-app-devel-list Digest, Vol 156, Issue 16

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gtk-app-devel-list Digest, Vol 156, Issue 16

Richard Shann

> Date: Fri, 21 Apr 2017 09:01:54 +0000
> From: R?ben Rodrigues <[hidden email]>
> To: "[hidden email]" <[hidden email]>
> Subject: CheckButton background color
> Message-ID:
> <[hidden email]>
>
> 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

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Loading...