added CTkSwitch

This commit is contained in:
Tom Schimansky
2022-03-08 15:03:47 +01:00
parent ccdbc6aca4
commit 3285eba2ef
10 changed files with 404 additions and 12 deletions

View File

@ -61,4 +61,14 @@ label_3 = customtkinter.CTkLabel(root_tk, width=200, textvariable=check_var)
label_3.pack(pady=15)
label_3.configure(textvariable=check_var)
def switch_event():
print("switch event")
s_var = tkinter.StringVar(value="on")
switch_1 = customtkinter.CTkSwitch(master=root_tk, variable=s_var, textvariable=s_var, onvalue="on", offvalue="off", command=switch_event)
switch_1.pack(pady=20, padx=10)
switch_1 = customtkinter.CTkSwitch(master=root_tk, variable=s_var, textvariable=s_var, onvalue="on", offvalue="off")
switch_1.pack(pady=20, padx=10)
#switch_1.toggle()
root_tk.mainloop()