def QuitGame(self): self.message=tkMessageBox.askquestion("Exit","Do you want to exit ?") if (self.message == 'yes'): root.destroy()