-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformelements.py
50 lines (36 loc) · 1.45 KB
/
formelements.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
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('800x550')
def checker():
if var1.get() == 1:
my_label.config(text="Checked!")
else:
my_label.config(text="Unchecked!")
# Label
my_label = tb.Label(root, text="Click the checkbox below if you are not robot", font=("Poppins", 15))
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)
# Round 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)
# Round ToolButton
var3 = IntVar()
my_check3 = tb.Checkbutton(bootstyle="info, toolbutton, outline", text="Outlined toolButton!!", variable=var3, onvalue=1, offvalue=0, command=checker)
my_check3.pack(pady=10)
# Rount 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()