Changes

385 bytes added ,  09:13, 14 November 2011
Line 205: Line 205:  
# To invalidate a region to force a refresh, use:
 
# To invalidate a region to force a refresh, use:
 
self.canvas.queue_draw_area(x, y, w, h)
 
self.canvas.queue_draw_area(x, y, w, h)
 +
 +
# Handle the expose-event by drawing
 +
def do_expose_event(self, event):
 +
    # Create the cairo context
 +
    cairo_context = self.canvas.get_window().cairo_create(
 +
    cairo_context.rectangle(event.area.x, event.area.y,
 +
                            event.area.width, event.area.height)
 +
    cairo_context.clip()
 +
    cairo_context.set_source_surface(xlib_surface)
 +
    cairo_context.paint()
 
</pre>
 
</pre>