Advertisement
Guest User

Checkbuttons Under Windows 10

a guest
Dec 13th, 2019
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import tkinter as tk
  2. import tkinter.ttk as ttk
  3.  
  4. root = tk.Tk()
  5. checked = tk.IntVar()
  6. checked.set(1)
  7. unchecked = tk.IntVar()
  8. unchecked.set(0)
  9.  
  10. # check-dc.gif
  11. check_dc = ttk.Checkbutton(root, state='disabled', variable=checked)
  12. check_dc.grid(row=0, column=0)
  13.  
  14. # check-du.gif
  15. check_du = ttk.Checkbutton(root, state='disabled', variable=unchecked)
  16. check_du.grid(row=0, column=1)
  17.  
  18. #
  19. check_nc = ttk.Checkbutton(root, state='normal', variable=checked)
  20. check_nc.grid(row=0, column=2)
  21.  
  22. #
  23. check_nu = ttk.Checkbutton(root, state='normal', variable=unchecked)
  24. check_nu.grid(row=0, column=3)
  25.  
  26. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement