I donโt know anything about styling CSS in GTK3 (except that it often breaks down, because developers prefer to fix things - respect CSS standards - than maintain compatibility through versions).
However, I can tell you that this is wrong:
g_signal_connect_swapped(window,"delete-event",G_CALLBACK(gtk_widget_destroy),window);
What do you really want to stop GTK when the main window is closed. This is done as follows:
g_signal_connect(window,"destroy", G_CALLBACK(gtk_main_quit), NULL);
One more note: you are calling
gtk_widget_show(window); gtk_widget_show(button);
When the widget tree is complete (i.e. you stopped adding widgets in containers and containers in the top-level window), this can be simplified:
gtk_widget_show_all(window);
Also note that a running program should return 0 on success and use non-zero values โโfor report errors.
source share