Just a minor style thing: the additional parentheses around self.window are unnecessary.