mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
testpicture: Add an animation demo
This commit is contained in:
parent
db3d517c22
commit
403260b18b
@ -209,6 +209,17 @@ create_slowly_loading_image (Demo *demo)
|
||||
gtk_box_pack_start (GTK_BOX (demo->widget), image, TRUE, TRUE, 0);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user