-
Notifications
You must be signed in to change notification settings - Fork 0
/
75_checkbox.py
32 lines (27 loc) · 870 Bytes
/
75_checkbox.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from tkinter import *
def display():
if(x.get() == 1):
print("You agree!")
else:
print("You don't agree!")
window = Tk()
logo = PhotoImage(file='py.png')
x = IntVar()
check_button = Checkbutton(window,
text="I agree to something",
variable=x,
onvalue=1,
offvalue=0,
command=display,
font=('Arial',20),
fg='green',
bg='black',
activebackground='black',
activeforeground='green',
padx=25,
pady=10,
image=logo,
compound='left'
)
check_button.pack()
window.mainloop()