how to instantly drawing



I try to paint on the GtkWidget->window .
For example, I have a GtkWindow called "mainwindow", I try to draw on
its GdkWindow that is mainwindow->window.
I try to draw a red line, then after 1 second I will draw a green line
at the same place.

so the code will be look like:

drawline(red, mainwindow->window,...);
sleep(1);
drawline(green, mainwindow->window,..);

But what happened is: each time it only shows up the green line, never
see the red line, even didnot see the screen reflesh.

I know I can put the code in the configure event call back function of
the mainwindow.  But I donot want to reflesh the whole screen, so I
didn't send out the configure_event signal .

I wonder whether there is a way to instantly draw on the GdkWIndow
(which is GtkWidget->window), and show on the screen immediately!!

I  appreciate any Help! If someone knows, Please teach me ASAP,

Thanks very much

Jiang



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