[gtk+] testgtk: Make image test not use Pixmaps, but Pixbufs



commit ad571a3a5e335c4c879ecfb52c6cf0c6331ddafd
Author: Benjamin Otte <otte redhat com>
Date:   Fri Aug 6 21:54:16 2010 +0200

    testgtk: Make image test not use Pixmaps, but Pixbufs

 tests/testgtk.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 2a8f098..33c40c0 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -3092,8 +3092,7 @@ create_image (GtkWidget *widget)
   if (window == NULL)
     {
       GtkWidget *vbox;
-      GdkPixmap *pixmap;
-      GdkBitmap *mask;
+      GdkPixbuf *pixbuf;
         
       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
       
@@ -3117,14 +3116,12 @@ create_image (GtkWidget *widget)
                   gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING,
                                             GTK_ICON_SIZE_DIALOG));
 
-      pixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL,
-                                                      gtk_widget_get_colormap (window),
-                                                      &mask,
-                                                      NULL,
-                                                      openfile);
+      pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) openfile);
       
-      pack_image (vbox, "Pixmap",
-                  gtk_image_new_from_pixmap (pixmap, mask));
+      pack_image (vbox, "Pixbuf",
+                  gtk_image_new_from_pixbuf (pixbuf));
+
+      g_object_unref (pixbuf);
     }
 
   if (!gtk_widget_get_visible (window))



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