Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. import tkinter as tk
  2. from tkinter import ttk
  3.  
  4.  
  5. root = tk.Tk()
  6.  
  7. a = tk.BooleanVar()
  8. b = tk.BooleanVar()
  9.  
  10. print(b.get())
  11.  
  12. def func_a():
  13.     if a.get():
  14.         print(a.get())
  15.     else:
  16.         print(a.get())
  17.  
  18. def func_b():
  19.     if b.get():
  20.         print(b.get())
  21.     else:
  22.         print(b.get())
  23.  
  24. a_btn = tk.Checkbutton(root, text='Yes', variable=a, onvalue=1, offvalue=0, command=func_a, width=15)
  25. a_btn.grid(row=0)
  26. b_btn = tk.Checkbutton(root, text='yes', variable=b, onvalue=1, offvalue=0, command=func_b, width=15)
  27. b_btn.grid(row=1)
  28.  
  29. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement