Advertisement
Rnery

Teste de cores no Tkinter..

Aug 25th, 2021 (edited)
234
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | Source Code | 1 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3.  
  4. import tkinter as tk
  5.  
  6. root = tk.Tk()
  7.  
  8. def gray_label():
  9.     label_text.config(fg = "#FFFF00", bg = "#FFD700")
  10.  
  11. label_text = tk.Label(root, text = "Texto", fg = "blue",
  12.     font = 'Helvetica 20 italic')
  13.  
  14. label_text.place(x = '20', y = '20')
  15.  
  16. checkbox = tk.Checkbutton(root, command = lambda: gray_label())
  17. checkbox.place(x = '20', y = '80')
  18.  
  19. root.title('Tkinter Cores')
  20. root.resizable(False, False)
  21. root.config(background = 'white')
  22. root.geometry('250x200')
  23. root.eval('tk::PlaceWindow . center')
  24. root.mainloop()
  25.  
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement