code: def expose_event(self, widget, event):
          
          x, y, width, height = event.area
          self.logger.debug("surface is %s" % self.surface)
          if self.surface is not None:
              win = widget.get_window()
              cr = win.cairo_create()
  
              # set clip area for exposed region
              cr.rectangle(x, y, width, height)
              cr.clip()
  
              # Paint from off-screen surface
              cr.set_source_surface(self.surface, 0, 0)
              cr.set_operator(cairo.OPERATOR_SOURCE)
              cr.paint()
  
          return False
docs: When an area of the window is exposed, we just copy out of the
          server-side, off-screen surface to that area.