Path: blob/main/Business/Desktop/example.py
2940 views
import tkinter1import customtkinter23customtkinter.set_appearance_mode("dark") # Modes: "System" (standard), "Dark", "Light"4customtkinter.set_default_color_theme("blue") # Themes: "blue" (standard), "green", "dark-blue"56app = customtkinter.CTk()7app.geometry("400x580")8app.title("CustomTkinter simple_example.py")91011def button_callback():12print("Button click", combobox_1.get())131415def slider_callback(value):16progressbar_1.set(value)171819frame_1 = customtkinter.CTkFrame(master=app)20frame_1.pack(pady=20, padx=60, fill="both", expand=True)2122label_1 = customtkinter.CTkLabel(master=frame_1, justify=tkinter.LEFT)23label_1.pack(pady=12, padx=10)2425progressbar_1 = customtkinter.CTkProgressBar(master=frame_1)26progressbar_1.pack(pady=12, padx=10)2728button_1 = customtkinter.CTkButton(master=frame_1, command=button_callback)29button_1.pack(pady=12, padx=10)3031slider_1 = customtkinter.CTkSlider(master=frame_1, command=slider_callback, from_=0, to=1)32slider_1.pack(pady=12, padx=10)33slider_1.set(0.5)3435entry_1 = customtkinter.CTkEntry(master=frame_1, placeholder_text="CTkEntry")36entry_1.pack(pady=12, padx=10)3738optionmenu_1 = customtkinter.CTkOptionMenu(frame_1, values=["Option 1", "Option 2", "Option 42 long long long..."])39optionmenu_1.pack(pady=12, padx=10)40optionmenu_1.set("CTkOptionMenu")4142combobox_1 = customtkinter.CTkComboBox(frame_1, values=["Option 1", "Option 2", "Option 42 long long long..."])43combobox_1.pack(pady=12, padx=10)44optionmenu_1.set("CTkComboBox")4546checkbox_1 = customtkinter.CTkCheckBox(master=frame_1)47checkbox_1.pack(pady=12, padx=10)4849radiobutton_var = tkinter.IntVar(value=1)5051radiobutton_1 = customtkinter.CTkRadioButton(master=frame_1, variable=radiobutton_var, value=1)52radiobutton_1.pack(pady=12, padx=10)5354radiobutton_2 = customtkinter.CTkRadioButton(master=frame_1, variable=radiobutton_var, value=2)55radiobutton_2.pack(pady=12, padx=10)5657switch_1 = customtkinter.CTkSwitch(master=frame_1)58switch_1.pack(pady=12, padx=10)5960app.mainloop()616263