diff options
author | Matthias Clasen <mclasen@redhat.com> | 2008-05-29 14:33:49 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-05-29 14:33:49 +0000 |
commit | ee8253f908d2541321d72a0151fcfeb7446f7b8f (patch) | |
tree | aba76516a9370271ff86850367542c38b61a7d7b /tests | |
parent | 24ac36693bebbd22416f91fc78c6fe189f953d94 (diff) | |
download | gtk+-ee8253f908d2541321d72a0151fcfeb7446f7b8f.tar.gz |
Bug 522084 – GIcon support for GtkIconTheme & GtkImage
2008-05-27 Matthias Clasen <mclasen@redhat.com>
Bug 522084 – GIcon support for GtkIconTheme & GtkImage
* gtk/gtkicontheme.[hc]: Add support for GIcon based lookups.
* gtk/gtkimage.[hc]: Allow setting an image from a GIcon.
* gtk/gtk.symbols: Additions
* tests/testimage.c: Add a GIcon test
svn path=/trunk/; revision=20236
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testimage.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/testimage.c b/tests/testimage.c index 0e40f247b8..e9bd7d748c 100644 --- a/tests/testimage.c +++ b/tests/testimage.c @@ -18,6 +18,7 @@ */ #include <gtk/gtk.h> +#include <gio/gio.h> static void drag_begin (GtkWidget *widget, @@ -103,6 +104,8 @@ main (int argc, char **argv) GtkIconSource *iconsource; gchar *icon_name = "gnome-terminal"; gchar *anim_filename = NULL; + GIcon *icon; + GFile *file; gtk_init (&argc, &argv); @@ -173,6 +176,20 @@ main (int argc, char **argv) gtk_image_set_pixel_size (GTK_IMAGE (image), 30); gtk_table_attach_defaults (GTK_TABLE (table), image, 2, 3, 4, 5); + label = gtk_label_new ("GTK_IMAGE_GICON"); + gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 5, 6); + icon = g_themed_icon_new_with_default_fallbacks ("folder-remote"); + image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG); + g_object_unref (icon); + gtk_table_attach_defaults (GTK_TABLE (table), image, 1, 2, 5, 6); + file = g_file_new_for_path ("apple-red.png"); + icon = g_file_icon_new (file); + image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_DIALOG); + g_object_unref (icon); + gtk_image_set_pixel_size (GTK_IMAGE (image), 30); + gtk_table_attach_defaults (GTK_TABLE (table), image, 2, 3, 5, 6); + + if (anim_filename) { label = gtk_label_new ("GTK_IMAGE_ANIMATION (from file)"); |