2022-05-22 21:26:31 +03:00
|
|
|
import customtkinter
|
2022-08-06 01:55:47 +03:00
|
|
|
from PIL import Image, ImageTk
|
2022-01-22 22:28:59 +03:00
|
|
|
import os
|
|
|
|
|
|
|
|
PATH = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
|
2022-03-13 03:26:18 +03:00
|
|
|
|
2022-11-01 02:37:30 +03:00
|
|
|
app = customtkinter.CTk()
|
2022-01-22 22:28:59 +03:00
|
|
|
|
2022-11-01 02:37:30 +03:00
|
|
|
switch_1 = customtkinter.CTkSwitch(app, text="darkmode", command=lambda: customtkinter.set_appearance_mode("dark" if switch_1.get() == 1 else "light"))
|
|
|
|
switch_1.pack(padx=20, pady=20)
|
2022-10-22 16:42:22 +03:00
|
|
|
|
2022-11-01 02:37:30 +03:00
|
|
|
image_1 = customtkinter.CTkImage(light_image=Image.open(PATH + "/test_images/add_folder_dark.png"),
|
|
|
|
dark_image=Image.open(PATH + "/test_images/add_folder_light.png"),
|
|
|
|
size=(30, 50))
|
|
|
|
image_1.configure(dark_image=Image.open(PATH + "/test_images/add_folder_light.png"))
|
2022-01-22 22:28:59 +03:00
|
|
|
|
2022-11-01 02:37:30 +03:00
|
|
|
button_1 = customtkinter.CTkButton(app, image=image_1)
|
|
|
|
button_1.pack(padx=20, pady=20)
|
2022-01-22 22:28:59 +03:00
|
|
|
|
2022-11-01 02:37:30 +03:00
|
|
|
app.mainloop()
|
2022-01-22 22:28:59 +03:00
|
|
|
|