small example modifications

This commit is contained in:
Tom Schimansky 2021-12-28 18:26:29 +01:00
parent 9109663848
commit 9124314e97
3 changed files with 3 additions and 4 deletions

View File

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

View File

@ -4,7 +4,7 @@ import customtkinter
from PIL import Image, ImageTk from PIL import Image, ImageTk
import os import os
customtkinter.set_appearance_mode("System") # Other: "Light", "Dark" customtkinter.set_appearance_mode("Dark") # Other: "Light", "System"
PATH = os.path.dirname(os.path.realpath(__file__)) PATH = os.path.dirname(os.path.realpath(__file__))

View File

@ -3,7 +3,6 @@ import customtkinter # <- import the CustomTkinter module
customtkinter.enable_macos_darkmode() customtkinter.enable_macos_darkmode()
customtkinter.set_appearance_mode("System") # Other: "Dark", "Light" customtkinter.set_appearance_mode("System") # Other: "Dark", "Light"
# customtkinter.set_theme_color(("red2", "red3"), ("red3", "red4"))
root_tk = tkinter.Tk() # create the Tk window like you normally do root_tk = tkinter.Tk() # create the Tk window like you normally do
root_tk.geometry("400x300") root_tk.geometry("400x300")
@ -35,7 +34,7 @@ button_1 = customtkinter.CTkButton(master=frame_1, corner_radius=10, command=but
button_1.place(relx=0.5, rely=0.4, anchor=tkinter.CENTER) button_1.place(relx=0.5, rely=0.4, anchor=tkinter.CENTER)
# button_1.configure(state="disabled") # button_1.configure(state="disabled")
slider_1 = customtkinter.CTkSlider(master=frame_1, command=slider_function, from_=0, to=1, progress_color=("gray65", "gray40")) slider_1 = customtkinter.CTkSlider(master=frame_1, command=slider_function, from_=0, to=1)
slider_1.place(relx=0.5, rely=0.55, anchor=tkinter.CENTER) slider_1.place(relx=0.5, rely=0.55, anchor=tkinter.CENTER)
slider_1.set(1.5) slider_1.set(1.5)