[gtk/matthiasc/for-master: 7/7] gtk-demo: Speed up image demo
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 7/7] gtk-demo: Speed up image demo
- Date: Thu, 22 Oct 2020 04:24:41 +0000 (UTC)
commit a11046a96bf28904105c3db7c5f76d4ef9b26875
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Oct 22 00:22:15 2020 -0400
gtk-demo: Speed up image demo
The progressive loading demo here was so slow as to appear
broken. Make it faster, and ensure that it updates regularly.
demos/gtk-demo/images.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c
index e13302eb53..22177a7f5c 100644
--- a/demos/gtk-demo/images.c
+++ b/demos/gtk-demo/images.c
@@ -56,6 +56,7 @@ progressive_updated_callback (GdkPixbufLoader *loader,
picture = GTK_WIDGET (data);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
+ gtk_picture_set_pixbuf (GTK_PICTURE (picture), NULL);
gtk_picture_set_pixbuf (GTK_PICTURE (picture), pixbuf);
}
@@ -262,7 +263,7 @@ start_progressive_loading (GtkWidget *picture)
* The timeout simply simulates a slow data source by inserting
* pauses in the reading process.
*/
- load_timeout = g_timeout_add (1500, progressive_timeout, picture);
+ load_timeout = g_timeout_add (300, progressive_timeout, picture);
g_source_set_name_by_id (load_timeout, "[gtk] progressive_timeout");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]