summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2011-02-13 22:23:56 +0100
committerBenjamin Otte <otte@redhat.com>2011-02-14 19:33:04 +0100
commit403260b18bc35eee5c41b998f6cfc21c21c06897 (patch)
treec3806b09bfe90ef68f17172a07372d5f64e5e932
parentdb3d517c22e27ecec7078d2a3b178c28de66fb3e (diff)
downloadgtk+-403260b18bc35eee5c41b998f6cfc21c21c06897.tar.gz
testpicture: Add an animation demo
-rw-r--r--tests/testpicture.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/testpicture.c b/tests/testpicture.c
index 3bb711932e..0743fc8964 100644
--- a/tests/testpicture.c
+++ b/tests/testpicture.c
@@ -210,6 +210,17 @@ create_slowly_loading_image (Demo *demo)
}
static void
+create_animation (Demo *demo)
+{
+ GdkPixbufAnimation *animation = gdk_pixbuf_animation_new_from_file ("1234.gif", NULL);
+
+ demo->widget = gtk_label_new ("bla");
+ demo->picture = gdk_pixbuf_animation_picture_new (animation);
+
+ g_object_unref (animation);
+}
+
+static void
create_stock_picture (Demo *demo)
{
demo->widget = gtk_image_new_from_stock (GTK_STOCK_GOTO_FIRST, GTK_ICON_SIZE_BUTTON);
@@ -523,6 +534,7 @@ create_scribble_area (Demo *demo)
Demo demos[] = {
{ "Slowly loading image", create_slowly_loading_image, NULL, NULL },
+ { "Animation", create_animation, NULL, NULL },
{ "Named theme icons", create_stock_picture, NULL, NULL },
{ "Icon Set", create_icon_set_picture, NULL, NULL },
{ "GIcon", create_gicon_picture, NULL, NULL },
@@ -718,7 +730,7 @@ main (int argc, char **argv)
gtk_init (&argc, &argv);
- gdk_window_set_debug_updates (TRUE);
+ //gdk_window_set_debug_updates (TRUE);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), "Pictures");