Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- import tkinter as tk
- root = tk.Tk()
- def gray_label():
- label_text.config(fg = "#FFFF00", bg = "#FFD700")
- label_text = tk.Label(root, text = "Texto", fg = "blue",
- font = 'Helvetica 20 italic')
- label_text.place(x = '20', y = '20')
- checkbox = tk.Checkbutton(root, command = lambda: gray_label())
- checkbox.place(x = '20', y = '80')
- root.title('Tkinter Cores')
- root.resizable(False, False)
- root.config(background = 'white')
- root.geometry('250x200')
- root.eval('tk::PlaceWindow . center')
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement