mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
readme wiki
This commit is contained in:
parent
a7f5e92d51
commit
c4dec82f2f
@ -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",
|
||||
|
@ -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()
|
||||
root_tk.mainloop()
|
||||
customtkinter.disable_macos_darkmode()
|
Loading…
Reference in New Issue
Block a user