fixed entry color when disabled

This commit is contained in:
Tom Schimansky
2022-11-11 13:06:26 +01:00
parent f18ac0c81a
commit cf62427f66
6 changed files with 41 additions and 23 deletions

View File

@ -110,11 +110,11 @@ class TestApp(customtkinter.CTk):
self.frame_3.place(relx=0.5, y=y + 80, anchor=tkinter.CENTER)
self.frame_3.configure(fg_color=("#EBECF3", "#4B577E"))
self.button_3 = customtkinter.CTkButton(master=self.ctk_frame_customized, command=lambda: x, border_width=3,
self.button_3 = customtkinter.CTkButton(master=self.ctk_frame_customized, command=lambda: None, border_width=3,
corner_radius=20, font=("times", 16))
self.button_3.place(relx=0.5, y=y + 160, anchor=tkinter.CENTER)
self.button_3.configure(border_color=("#4F90F8", "#6FADF9"), hover_color=("#3A65E8", "#4376EE"))
self.button_3.configure(fg_color=None)
self.button_3.configure(fg_color="transparent")
self.entry_3 = customtkinter.CTkEntry(master=self.ctk_frame_customized, font=("times", 16))
self.entry_3.place(relx=0.5, y=y + 240, anchor=tkinter.CENTER)
@ -152,7 +152,7 @@ class TestApp(customtkinter.CTk):
self.button_4 = customtkinter.CTkButton(master=self.tk_frame_customized, command=lambda: x, border_width=3)
self.button_4.place(relx=0.5, y=y + 160, anchor=tkinter.CENTER)
self.button_4.configure(border_color=("#4F90F8", "#6FADF9"), hover_color=("#3A65E8", "#4376EE"))
self.button_4.configure(fg_color=None)
self.button_4.configure(fg_color="transparent")
self.entry_4 = customtkinter.CTkEntry(master=self.tk_frame_customized)
self.entry_4.place(relx=0.5, y=y + 240, anchor=tkinter.CENTER)

View File

@ -15,14 +15,21 @@ def change_mode():
customtkinter.set_appearance_mode("dark")
def button_click_event():
dialog = customtkinter.CTkInputDialog(master=None, text="Type in a number:", title="Test")
def button_1_click_event():
dialog = customtkinter.CTkInputDialog(text="Type in a number:", title="Test")
print("Number:", dialog.get_input())
button = customtkinter.CTkButton(app, text="Open Dialog", command=button_click_event)
button.place(relx=0.5, rely=0.5, anchor=customtkinter.CENTER)
def button_2_click_event():
dialog = customtkinter.CTkInputDialog(text="long text "*100, title="Test")
print("Number:", dialog.get_input())
button_1 = customtkinter.CTkButton(app, text="Open Dialog", command=button_1_click_event)
button_1.pack(pady=20)
button_2 = customtkinter.CTkButton(app, text="Open Dialog", command=button_2_click_event)
button_2.pack(pady=20)
c1 = customtkinter.CTkCheckBox(app, text="dark mode", command=change_mode)
c1.place(relx=0.5, rely=0.8, anchor=customtkinter.CENTER)
c1.pack(pady=20)
app.mainloop()

View File

@ -7,17 +7,17 @@ app.title("test_vertical_widgets")
app.grid_columnconfigure(0, weight=1)
app.grid_rowconfigure((0, 1, 2, 3), weight=1)
progressbar_1 = customtkinter.CTkProgressBar(app, orient="horizontal")
progressbar_1 = customtkinter.CTkProgressBar(app, orientation="horizontal")
progressbar_1.grid(row=0, column=0, pady=20, padx=20)
progressbar_2 = customtkinter.CTkProgressBar(app, orient="vertical")
progressbar_2 = customtkinter.CTkProgressBar(app, orientation="vertical")
progressbar_2.grid(row=1, column=0, pady=20, padx=20)
slider_1 = customtkinter.CTkSlider(app, orient="horizontal", command=progressbar_1.set,
slider_1 = customtkinter.CTkSlider(app, orientation="horizontal", command=progressbar_1.set,
button_corner_radius=3, button_length=20)
slider_1.grid(row=2, column=0, pady=20, padx=20)
slider_2 = customtkinter.CTkSlider(app, orient="vertical", command=progressbar_2.set,
slider_2 = customtkinter.CTkSlider(app, orientation="vertical", command=progressbar_2.set,
button_corner_radius=3, button_length=20)
slider_2.grid(row=3, column=0, pady=20, padx=20)