diff --git a/Readme.md b/Readme.md index 1ec675d..ba49277 100644 --- a/Readme.md +++ b/Readme.md @@ -12,12 +12,12 @@ which can either be set manually or get controlled by the system appearance mode (only macOS). ### Example program (simple button): +To use CustomTkinter, just place the /customtkinter folder from this repository +next to your program, and then you can do `import customtkinter`. ```python import tkinter import customtkinter # <- import the CustomTkinter module -customtkinter.set_appearance_mode("Light") # Other: "Dark", "System" (only macOS) - root_tk = tkinter.Tk() # create the Tk window like you normally do root_tk.geometry("400x240") root_tk.title("CustomTkinter Test") @@ -43,6 +43,8 @@ If you specify custom colors for CustomTkinter elements, the you can either use tuple in the form: (light_color, dark_color). Or you can set a single color which will be used in light and dark theme. ```python +customtkinter.set_appearance_mode("Dark") # Other: "Light", "System" (only macOS) + button = customtkinter.CTkButton(master=root_tk, fg_color=("black", "lightgray"), # <- tuple color for light and dark theme text="CTkButton", diff --git a/simple_test.py b/simple_test.py index 122b119..6127b79 100644 --- a/simple_test.py +++ b/simple_test.py @@ -42,7 +42,8 @@ import tkinter import customtkinter -customtkinter.enable_macos_darkmode() +# customtkinter.enable_macos_darkmode() +customtkinter.set_appearance_mode("light") root_tk = tkinter.Tk() root_tk.geometry("250x150") @@ -54,4 +55,5 @@ def button_function(): button = customtkinter.CTkButton(master=root_tk, corner_radius=10, command=button_function) button.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER) -root_tk.mainloop() \ No newline at end of file +root_tk.mainloop() +customtkinter.disable_macos_darkmode() \ No newline at end of file