small example modifications

This commit is contained in:
Tom Schimansky 2021-12-28 18:35:45 +01:00
parent 9124314e97
commit 58108482c8
2 changed files with 41 additions and 3 deletions

View File

@ -86,7 +86,7 @@ class CTkSlider(tkinter.Frame):
def draw(self, no_color_updates=False):
# decide the drawing method
if sys.platform == "darwin" and 1==2:
if sys.platform == "darwin":
# on macOS draw button with polygons (positions are more accurate, macOS has Antialiasing)
self.draw_with_polygon_shapes()
else:

View File

@ -41,8 +41,46 @@ slider_1.set(1.5)
entry_1 = customtkinter.CTkEntry(master=frame_1)
entry_1.place(relx=0.5, rely=0.75, anchor=tkinter.CENTER)
checkbox_1 = customtkinter.CTkCheckBox(master=frame_1, command=check_box_function)
checkbox_1.place(relx=0.5, rely=0.9, anchor=tkinter.CENTER)
#checkbox_1 = customtkinter.CTkCheckBox(master=frame_1, command=check_box_function)
#checkbox_1.place(relx=0.5, rely=0.9, anchor=tkinter.CENTER)
color = {'main': '#FFFFFF',
'accent': '#F0F0F0',
'text': '#141414',
'red': '#FF3232',
'red_': '#DC1414',
'yellow': '#FFDC32',
'yellow_': '#F0C800',
'green': '#50C850',
'green_': '#32B432',
'teal': '#50C8C8',
'teal_': '#329696',
'blue': '#3296FF',
'blue_': '#1478FF',
'purple': '#9696FF',
'purple_': '#1478FF',
'white': '#FFFFFF',
'white_': '#F0F0F0',
'black': '#141414',
'black_': '#323232',
}
red_slider = customtkinter.CTkSlider(
from_=0, to=100,
command=lambda event: event,
progress_color=color['red'],
fg_color=color['accent'],
button_color=color['white_'],
button_hover_color=color['white_'],
master=frame_1,
height=20,
width=100)
red_slider.place(relx=0.5, rely=0.9)
red_slider.configure(fg_color=color['accent'], bg_color=None)
root_tk.mainloop()
customtkinter.disable_macos_darkmode()