Re: printf and refresh drawing area
- From: Russell Shaw <rjshaw netspace net au>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: printf and refresh drawing area
- Date: Mon, 31 May 2004 15:20:58 +1000
Fabrice Chinjoie wrote:
Hi,
I want to see a semi circle moving into a drawing area.
That's what I do :
gdk_draw_rectangle (widget->window,
widget->style->white_gc,
TRUE,
0, 0,
widget->allocation.width,
widget->allocation.height);
gdk_draw_arc(widget->window,
widget->style->black_gc,
TRUE,
X,
Y,
dcircle,
dcircle,
angle*64,
180*64);
change angle value...
This code is called by : timeout_handler =g_timeout_add(1000,
update_angle,widget);
When I'm doing this, the drawing area doesn't change. But... If I put a
printf(" angle %d \n",angle) after the gdk_draw_arc in the first
function. it works and I can see my semi circle move.
Any idea about this?
Thanks.
You should put these drawing functions in the "expose" event handler,
so it gets drawn whenever X sees the window coverage has changed.
http://www.gtk.org/tutorial/ch-scribble.html
Whenever your drawing changes, you can trigger your own expose event.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]