window.changePango(window) def changePango (self, child): if child is a container: for subChild in child.get_children(): changePango (subChild) else: change the child's pango context