#include static void reload (void) { static GtkWidget *window, *box, *image1, *image2, *image3; static GdkPixbuf *pixbuf; image1 = NULL; image2 = NULL; image3 = NULL; if (!window) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); if (box) { gtk_widget_destroy (box); } box = gtk_vbox_new (TRUE, 0); gtk_container_add (GTK_CONTAINER (window), box); pixbuf = gdk_pixbuf_new_from_file_at_scale ("testimage.svg", 500, 100, FALSE, NULL); if (pixbuf) { image1 = gtk_image_new_from_pixbuf (pixbuf); g_object_unref (pixbuf); } pixbuf = gdk_pixbuf_new_from_file_at_scale ("testimage.svg", 500, 100 / 2.0, FALSE, NULL); if (pixbuf) { image2 = gtk_image_new_from_pixbuf (pixbuf); g_object_unref (pixbuf); } pixbuf = gdk_pixbuf_new_from_file_at_scale ("testimage.svg", 500 / 2.0, 100, FALSE, NULL); if (pixbuf) { image3 = gtk_image_new_from_pixbuf (pixbuf); g_object_unref (pixbuf); } if (image1) gtk_container_add (GTK_CONTAINER (box), image1); if (image2) gtk_container_add (GTK_CONTAINER (box), image2); if (image3) gtk_container_add (GTK_CONTAINER (box), image3); gtk_widget_show_all (window); } int main (int argc, char **argv) { gtk_init (&argc, &argv); g_timeout_add (1000, reload, NULL); gtk_main (); return 0; }