Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- class QuitButton:
- def __init__(self, master):
- frame = Frame(master)
- frame.pack()
- self.printButton = Button(frame, text="Print Message", command=self.printMessage)
- self.printButton.pack(side=LEFT)
- self.quitButton = Button(frame, text="Quit", command=frame.master.destroy)
- self.quitButton.pack(side=LEFT)
- def printMessage(self):
- print("Wow, this actually worked")
- root = Tk()
- b = QuitButton(root)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement