Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- from tkinter import messagebox
- root = Tk()
- #add an event to the button
- def changeBGcolor():
- root.config(background="green")
- #add a button
- Button1 = Button(root, text="CHANGE BACKGROUND", height=2, width=20,
- command = changeBGcolor)
- Button1.place(x=50,y=50)
- root.geometry("300x200")
- root.mainloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement