0

How do I close the entire program once the user hits OK in the message box?

Here is the portion of the script that contains the button and command:

class Application(tk.Tk):
    def create_options(self):

        tk.Button(self,
                  text = "Begin search", command=self.pop_up1
                  ).place(x=465, y=285)

    def pop_up1(self):
        """shows submitted box"""
        tkMessageBox.showinfo(title="Finished", message="Query Submitted")
TheHoff
  • 61
  • 2
  • 13

1 Answers1

1

It depends what you mean by exit the entire program, you can close the window by using self.root.destroy() But depending on your implementation closing the window may not end your program but generally this is how you close a tkinter application. Just add it to the end of your button event.

D3181
  • 2,037
  • 5
  • 19
  • 44