Re: Drawing area force refresh



That did the trick! Thanks

John Coppens wrote:

On Sun, 11 Jul 2004 21:43:48 +1000
Nghia <nho optushome com au> wrote:

Hi,

I'm trying to make my own progress bar by drawing to a drawing area
widget.

This is my test code.

for(i=0; i < 100; i++)
{
      g_printf("Percent: %d\n", i);
      DrawProgessBar(drawing_area, pixmap, i);
      g_usleep(100000);
}

I have added code to update the drawing_area inside DrawProgressBar but it doesn't refresh in sync with the g_printf. The animation is rather "jerky".

Any ideas on how to make it in sync with the loop?

Could it be you have to to call gtk_main_iteration() in leach loop to
allow GTK to update the screen?

Depending on how you draw, you may have to call
gdk_window_invalidate_region() to indicate part of the image has been
modified.

John
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]