Understanding gtk_widget_queue_draw() (and dbl buffing)
- From: Derek Simkowiak <dereks kd-dev com>
- Cc: gtk-list gnome org
- Subject: Understanding gtk_widget_queue_draw() (and dbl buffing)
- Date: Thu, 25 May 2000 13:59:12 -0700 (PDT)
gtk_widget_queue_draw() does not double buffer, does it?
I took a quick glance at the code (1.2.6) and it seems to me that
widget_queue_draw() just merges together rectangle areas and then
schedules expose events on those rectangles when idle.
So, assuming my understanding is correct, the only advantage of
using widget_queue_draw() is that it's less network intensive, because
there are fewer expose events actually sent to the X server. Also, there
is an advantage that drawing is done when idle, so that the calculations
of your application/custom widget can continue without waiting for slow X
requests.
(In case it's not obvious, I'm a novice to X programming)
I'm working on a new widget (the View for my text widget), and I'm
wondering if I need to do double buffering myself. I've seen some
messages indicated that Gtk 1.4 would have built-in double buffering,
whatever that means.
Should I write my widget to do its own double buffering? If so, I
plan on having my expose signal handler draw first to a pixmap, and then
copy to the GdkWindow widget->window. Is that the right approach?
--Derek
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]