diff options
author | Benjamin Otte <otte@redhat.com> | 2010-08-06 22:37:34 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-08-10 21:02:31 +0200 |
commit | aaf70d13278494bb5c125ade8da30b06c5098562 (patch) | |
tree | 90e6a3f4c592991cd8ae119f6c36eed0eec329fc /tests/testgtk.c | |
parent | de285edc7290b510973c787e52a5f268acf0d078 (diff) | |
download | gtk+-aaf70d13278494bb5c125ade8da30b06c5098562.tar.gz |
testgtk: Use Cairo to load XBM image
This should really use GdkPixbuf, but apparently we can't load XBM
images. And I'm too lazy to convert it.
Diffstat (limited to 'tests/testgtk.c')
-rw-r--r-- | tests/testgtk.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c index 2f1a931870..0260a55acb 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -7425,8 +7425,9 @@ create_wmhints (GtkWidget *widget) GtkWidget *button; GtkWidget *box1; GtkWidget *box2; - GdkBitmap *circles; + cairo_surface_t *image; + cairo_t *cr; if (!window) { @@ -7444,10 +7445,17 @@ create_wmhints (GtkWidget *widget) gtk_widget_realize (window); - circles = gdk_bitmap_create_from_data (window->window, - (gchar *) circles_bits, - circles_width, - circles_height); + circles = gdk_pixmap_new (window->window, circles_width, circles_height, 1); + cr = gdk_cairo_create (circles); + image = cairo_image_surface_create_for_data (circles_bits, CAIRO_FORMAT_A1, + circles_width, circles_height, + circles_width / 8); + cairo_set_source_surface (cr, image, 0, 0); + cairo_surface_destroy (image); + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); + cairo_paint (cr); + cairo_destroy (cr); + gdk_window_set_icon (window->window, NULL, circles, circles); |