On 1/13/06, Gravis Zero <[EMAIL PROTECTED]> wrote: > not exposed until after you load the file. needless to say i would like > to be able to load the image into the drawing area when loaded instead > of when it is exposed as it make the app look slugish or frozen. i have
I would load the image in chunks (perhaps 100 scan lines?). For each chunk, gtk_widget_queue_draw_area() then let the mainloop run for a few iterations so the expose is processed. Something like (untested): // malloced memory we load to guchar *image_buffer; void load_image_progressive( GtkWidget *drawing_area ) { static const int chunk_height = 100; int y; for( y = 0; y < 4096; y += chunk_height ) { read( fd, image_buffer + y * 4096, 4096 * chunk_height ); gtk_widget_queue_draw( drawing_area, 0, y, 4096, chunk_height ); while( g_main_context_iteration( NULL, FALSE ) ) ; } } _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list