I was wrong
rectangle
is present in cairo.Context
but not in pango.Context
I used pango.Context
because I couldn't find show_layout
in cairo.Context
Now I see the method is not in pango.Context
object either
We have to use unbounded method PangoCairo.show_layout
Summary:
cr = self.get_window().cairo_create()
cr.rectangle(0, 0, w, h)
PangoCairo.show_layout(cr, layout)