changed images in Readme
@ -136,11 +136,13 @@ also look acceptable on Windows. Maybe you can use the parameters for
|
|||||||
|
|
||||||
Example 1:```examples/complex_example.py```
|
Example 1:```examples/complex_example.py```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
Example 2: ```examples/complex_example_custom_colors.py```
|
Example 2: ```examples/complex_example_custom_colors.py```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### CTkButton with images
|
### CTkButton with images
|
||||||
It's also possible to put an image on a CTkButton. You just have to
|
It's also possible to put an image on a CTkButton. You just have to
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
__version__ = "1.8"
|
__version__ = "2.0"
|
||||||
|
|
||||||
from .customtkinter_button import CTkButton
|
from .customtkinter_button import CTkButton
|
||||||
from .customtkinter_slider import CTkSlider
|
from .customtkinter_slider import CTkSlider
|
||||||
|
@ -19,7 +19,6 @@ class CTkColorManager:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def initialize_color_theme(cls, theme_name):
|
def initialize_color_theme(cls, theme_name):
|
||||||
print("set theme", theme_name)
|
|
||||||
|
|
||||||
if theme_name.lower() == "blue":
|
if theme_name.lower() == "blue":
|
||||||
cls.WINDOW_BG = ("#ECECEC", "#323232") # macOS standard light and dark window bg colors
|
cls.WINDOW_BG = ("#ECECEC", "#323232") # macOS standard light and dark window bg colors
|
||||||
|
@ -75,7 +75,7 @@ class CTkEntry(tkinter.Frame):
|
|||||||
width=1,
|
width=1,
|
||||||
highlightthicknes=0,
|
highlightthicknes=0,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
self.entry.grid(column=0, row=0, sticky="we", padx=self.corner_radius if self.corner_radius >= 5 else 5)
|
self.entry.grid(column=0, row=0, sticky="we", padx=self.corner_radius if self.corner_radius >= 6 else 6)
|
||||||
|
|
||||||
self.fg_parts = []
|
self.fg_parts = []
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ class CTkEntry(tkinter.Frame):
|
|||||||
elif self.corner_radius * 2 > self.width:
|
elif self.corner_radius * 2 > self.width:
|
||||||
self.corner_radius = self.width / 2
|
self.corner_radius = self.width / 2
|
||||||
|
|
||||||
self.entry.grid(column=0, row=0, sticky="we", padx=self.corner_radius if self.corner_radius >= 5 else 5)
|
self.entry.grid(column=0, row=0, sticky="we", padx=self.corner_radius if self.corner_radius >= 6 else 6)
|
||||||
del kwargs["corner_radius"]
|
del kwargs["corner_radius"]
|
||||||
require_redraw = True
|
require_redraw = True
|
||||||
|
|
||||||
|
BIN
documentation_images/Windows_complex_dark.png
Normal file
After Width: | Height: | Size: 276 KiB |
BIN
documentation_images/Windows_complex_light.png
Normal file
After Width: | Height: | Size: 274 KiB |
BIN
documentation_images/Windows_complex_other_style.png
Normal file
After Width: | Height: | Size: 282 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 285 KiB After Width: | Height: | Size: 644 KiB |
@ -42,20 +42,20 @@ class App(customtkinter.CTk):
|
|||||||
corner_radius=0)
|
corner_radius=0)
|
||||||
self.frame.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)
|
self.frame.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)
|
||||||
|
|
||||||
self.label_1 = customtkinter.CTkLabel(master=self.frame, corner_radius=10, width=200, height=60,
|
self.label_1 = customtkinter.CTkLabel(master=self.frame, corner_radius=6, width=200, height=60,
|
||||||
fg_color=("gray70", "gray20"), text="CustomTkinter\ninterface example")
|
fg_color=("gray70", "gray20"), text="CustomTkinter\ninterface example")
|
||||||
self.label_1.place(relx=0.5, rely=0.3, anchor=tkinter.CENTER)
|
self.label_1.place(relx=0.5, rely=0.3, anchor=tkinter.CENTER)
|
||||||
|
|
||||||
self.entry_1 = customtkinter.CTkEntry(master=self.frame, corner_radius=10, width=200)
|
self.entry_1 = customtkinter.CTkEntry(master=self.frame, corner_radius=20, width=200)
|
||||||
self.entry_1.place(relx=0.5, rely=0.52, anchor=tkinter.CENTER)
|
self.entry_1.place(relx=0.5, rely=0.52, anchor=tkinter.CENTER)
|
||||||
self.entry_1.insert(0, "username")
|
self.entry_1.insert(0, "username")
|
||||||
|
|
||||||
self.entry_2 = customtkinter.CTkEntry(master=self.frame, corner_radius=10, width=200, show="*")
|
self.entry_2 = customtkinter.CTkEntry(master=self.frame, corner_radius=20, width=200, show="*")
|
||||||
self.entry_2.place(relx=0.5, rely=0.6, anchor=tkinter.CENTER)
|
self.entry_2.place(relx=0.5, rely=0.6, anchor=tkinter.CENTER)
|
||||||
self.entry_2.insert(0, "password")
|
self.entry_2.insert(0, "password")
|
||||||
|
|
||||||
self.button_2 = customtkinter.CTkButton(master=self.frame, text="Login",
|
self.button_2 = customtkinter.CTkButton(master=self.frame, text="Login",
|
||||||
corner_radius=10, command=self.button_event, width=200)
|
corner_radius=6, command=self.button_event, width=200)
|
||||||
self.button_2.place(relx=0.5, rely=0.7, anchor=tkinter.CENTER)
|
self.button_2.place(relx=0.5, rely=0.7, anchor=tkinter.CENTER)
|
||||||
|
|
||||||
def button_event(self):
|
def button_event(self):
|
||||||
|
2
setup.py
@ -19,7 +19,7 @@ def read(filename):
|
|||||||
|
|
||||||
|
|
||||||
setup(name="customtkinter",
|
setup(name="customtkinter",
|
||||||
version="1.8",
|
version="2.0",
|
||||||
author="Tom Schimansky",
|
author="Tom Schimansky",
|
||||||
license="Creative Commons Zero v1.0 Universal",
|
license="Creative Commons Zero v1.0 Universal",
|
||||||
url="https://github.com/TomSchimansky/CustomTkinter",
|
url="https://github.com/TomSchimansky/CustomTkinter",
|
||||||
|