I have a several classes, all derived from a single base class Artist,
which render into a gtk.gdk.Drawable with a call to 'draw'.  Artist
instances can contain instances of Artist children.  When an instance
receives a draw request (may come from interactive use or a timeout)
it draws into the drawable and then passes the request on to the
children it contains.

The problem is that this introduces flicker as A draws it's
background, and then A's children draw over it.

There is, however, one Artist instance that all the drawing requests
filter through, and what I would like to do is suppress the screen
redraw until all the children are through drawing.  Sometime like

  screen_refresh_off()
  self.draw(drawable)
  for child in self.get_artists():
      child.draw(drawable)
  screen_refresh_on()

Where drawable is a gtk.gdk.Window.  What I am currently doing is
drawing to a pixmap

  self.draw(pixmap)
  for child in self.get_artists():
      child.draw(pixmap)
  drawable.draw_drawable(gc, pixmap, 0, 0, 0, 0, self.width, self.height)

This works, and produces flicker free drawings, but I suffer a
performance hit.  Since I believe pygtk2 already does double buffering
with drawing areas, I wonder if I am duplicating some effort that
might be saved with some magic tidbit of knowledge.

Thanks
John Hunter

pygtk 1.99.16
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to