/*  Compile With:
*   gcc -Wall -o example `pkg-config --cflags --libs gtk+-3.0` example.c
*/
#include <gtk/gtk.h>

int main (int argc, char* argv[])
{
    GtkWidget *window, *button;

    gtk_init (&argc, &argv);

    /*-------- CSS ------------------------------------------------------------------------------------------------------------------------------------------*/
    GtkCssProvider *provider = gtk_css_provider_new ();

    gtk_css_provider_load_from_data (provider, "GtkButton {background-color: red;}", -1, NULL);

    GdkDisplay *display = gdk_display_get_default ();
    GdkScreen *screen = gdk_display_get_default_screen (display);

    gtk_style_context_add_provider_for_screen (screen,
                                               GTK_STYLE_PROVIDER (provider),
                                               GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);

    g_object_unref (provider);
    /*--------------------------------------------------------------------------------------------------------------------------------------------------*/

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    button = gtk_button_new_from_icon_name ("gtk-about", GTK_ICON_SIZE_DIALOG);
    gtk_window_set_default_size (GTK_WINDOW(window), 320, 240);

    gtk_container_add (GTK_CONTAINER (window), button);

    g_signal_connect_swapped(G_OBJECT(window),
                             "destroy",
                             G_CALLBACK(gtk_main_quit),
                             NULL);

    gtk_widget_show_all (window);
    gtk_main ();
    return(0);
}
