-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcheckbuttons.py
75 lines (61 loc) · 1.43 KB
/
checkbuttons.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from tkinter import *
import ttkbootstrap as tb
root = tb.Window(themename="superhero")
#root = Tk()
root.title("TTK Bootstrap!")
root.iconbitmap('images/codemy.ico')
root.geometry('500x350')
def checker():
if var1.get() == 1:
my_label.config(text="Checked!")
else:
my_label.config(text="Unchecked!")
# Label
my_label = Label(text="Click the checkbutton below", font=("Helvetica", 18))
my_label.pack(pady=(40,10))
# CheckButton
var1 = IntVar()
my_check = tb.Checkbutton(bootstyle="primary",
text="Check Me Out!",
variable=var1,
onvalue=1,
offvalue=0,
command=checker)
my_check.pack(pady=10)
# Toolbutton
var2 = IntVar()
my_check2 = tb.Checkbutton(bootstyle="danger, toolbutton",
text="ToolButton!!",
variable=var2,
onvalue=1,
offvalue=0,
command=checker)
my_check2.pack(pady=10)
# Outlines Toolbutton
var3 = IntVar()
my_check3 = tb.Checkbutton(bootstyle="danger, toolbutton, outline",
text="Outlined ToolButton!!",
variable=var3,
onvalue=1,
offvalue=0,
command=checker)
my_check3.pack(pady=10)
# Round Toggle Button
var4 = IntVar()
my_check4 = tb.Checkbutton(bootstyle="success, round-toggle",
text="Round Toggle!!",
variable=var4,
onvalue=1,
offvalue=0,
command=checker)
my_check4.pack(pady=10)
# Square Toggle Button
var5 = IntVar()
my_check5 = tb.Checkbutton(bootstyle="warning, square-toggle",
text="Square Toggle!!",
variable=var5,
onvalue=1,
offvalue=0,
command=checker)
my_check5.pack(pady=10)
root.mainloop()