-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUIcheckbox.py
29 lines (27 loc) · 925 Bytes
/
GUIcheckbox.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
from tkinter import *
def display():
if(x.get()):
print("You agree")
else:
print("You don't agree :(")
window = Tk()
x = BooleanVar()
python_img = PhotoImage(file='python_img.png')
check_button = Checkbutton(window,
text="I agree to something",
variable=x,
onvalue=True,
offvalue=False,
command=display,
font=("Arial",20),
fg="#00ff00",
bg="black",
activebackground="black",
activeforeground="#00ff00",
padx=25,
pady=10,
image=python_img,
compound='left'
)
check_button.pack()
window.mainloop()