def showWindow(self, x, y, w, h): if self.window == None: self.window = PrintWindow(x, y, w, h) else: self.window.updateDimensions(x, y, w, h) self.window.clear() self.viewport = {'x': x, 'y': y, 'width': w, 'height': h}