Re: Can I get widget change background color of simple way in modern gtk3?

I understand.

> this question has been asked and answered multiple times on this mailing list.
Indeed this is because it was unbelievable that.
That much became so difficult from simple.

I see useful example.

I intend to use this code.
    GtkCssProvider *provider;
    provider = gtk_css_provider_new ();

    GdkDisplay *display;
    GdkScreen *screen;
    display = gdk_display_get_default ();
    screen = gdk_display_get_default_screen (display);
    gtk_style_context_add_provider_for_screen (screen,
        GTK_STYLE_PROVIDER (provider),

    gtk_css_provider_load_from_data (GTK_CSS_PROVIDER(provider),
        " GtkWindow {\n"
        "   background-color: rgb (103, 103, 103);\n"
        "}\n", -1, NULL);
    g_object_unref (provider);


On 2015年11月29日 10:02, Emmanuele Bassi wrote:

this question has been asked and answered multiple times on this mailing list.

You should look at the archives on:


On 29 November 2015 at 00:26, michinari.nukazawa
<michinari nukazawa gmail com> wrote:

Old day.
I should have done writing code of simple one line if I demanded the change
of the background color
But it does not seem to be so now.
and nothing (simple) example code.
I see gtk3-demo. Using callback and other. not one line.

gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &color);
-> is deprecated

gtk_widget_override_background_color(window, GTK_STATE_NORMAL, &color);
-> is deprecated

Probably modern way is CSS Style.
But nothing example.
and ways seem to be different until now.

Can I get modern gtk3 example?
Can I change background color by writing code of simple one line in modern

gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]