#include <gtk/gtk.h>

gboolean on_expose_event(GtkWidget *widget, GdkEventExpose*, gpointer)
{
	cairo_t *cr = gdk_cairo_create(widget->window);
	cairo_set_source_rgb(cr, 0.5, 0.5, 0.5);
	cairo_rectangle(cr, 25, 25, 50, 50);
	cairo_fill(cr);
}

int main(int argc,char **argv)
{
    GtkWidget *window, *label;
	gtk_init(&argc, &argv);
	gtk_rc_parse_string(
			"style \"test\""
			"{"
			"bg[NORMAL] = \"#7f7f7f\""
			"}"
			"class \"GtkWidget\" style \"test\""
			);
	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_window_set_default_size(GTK_WINDOW(window), 100, 100);
	label = gtk_label_new("");
	gtk_container_add(GTK_CONTAINER(window), label);
	g_signal_connect(G_OBJECT(label), "expose-event", G_CALLBACK(on_expose_event), NULL);
	gtk_widget_show_all(window);
	gtk_main();
	return 0;
}
