def notify(self, event): if event.type == pygame.MOUSEBUTTONDOWN: if self.rect.collidepoint(event.pos): self.callback()