# creating a button instance in root
ExitButton = Button(self, text="Quit")
# placing the button on window in given position
ExitButton.place(x=0, y=0)
Button(self, text="Exit",command=self.client_exit)
def client_exit(self):
exit()
# creating a menu instance
menu = Menu(self.master)
self.master.config(menu=menu)
# create the file object)
file = Menu(menu)
# adds a command to the menu option, calling it exit, and the
# command it runs on event is client_exit
file.add_command(label="Exit", command=self.client_exit)
# added "file" to our menu
menu.add_cascade(label="File", menu=file)
# create the file object)
edit = Menu(menu)
# adds a command to the menu option, calling it exit, and the
# command it runs on event is client_exit
edit.add_command(label="Undo")
# added "file" to our menu
menu.add_cascade(label="Edit", menu=edit)