Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- from tkinter import ttk
- root = tk.Tk()
- a = tk.BooleanVar()
- b = tk.BooleanVar()
- print(b.get())
- def func_a():
- if a.get():
- print(a.get())
- else:
- print(a.get())
- def func_b():
- if b.get():
- print(b.get())
- else:
- print(b.get())
- a_btn = tk.Checkbutton(root, text='Yes', variable=a, onvalue=1, offvalue=0, command=func_a, width=15)
- a_btn.grid(row=0)
- b_btn = tk.Checkbutton(root, text='yes', variable=b, onvalue=1, offvalue=0, command=func_b, width=15)
- b_btn.grid(row=1)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement