Re: 'synchronous redraw' with a DrawingArea
- From: Soeren Sandmann <sandmann daimi au dk>
- To: Pascal Ognibene <pascal ognibene libertysurf fr>
- Cc: Sven Neumann <sven gimp org>, gtk-list gnome org
- Subject: Re: 'synchronous redraw' with a DrawingArea
- Date: 17 Apr 2004 13:51:06 +0200
Pascal Ognibene <pascal ognibene libertysurf fr> writes:
> 1) I'm not sure it would work if X11 or GTK try to merge the expose events
> for optimization. This mostly depends on the timing I guess
You should just call gtk_widget_queue_draw() or
gtk_widget_queeu_draw_area(). That will make gtk+ to eventually call
the expose handler of that widget.
Gtk+ does merge expose events together, but it will keep track of the
entire area that needs to be redrawn, so things will work regardless
of timing.
> 2) if it works there would be one useless redraw...
In this particular case gtk+ will be able to ignore the expose event
sent by the X server:
- if the expose event arrives *before* gtk+ gets around to
calling the expose handler of your widget, it will just be
merged in with the redraw you already scheduled.
- if the expose event arrives *after* gtk+ called your expose
handler, gtk+ checks if the X server knew about the painting
when it generated the expose events. If it didn't, the
expose event can just be thrown away.
Søren
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]