Re: Drawing area force refresh



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



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