mirror of
https://github.com/TomSchimansky/CustomTkinter.git
synced 2023-08-10 21:13:13 +03:00
fixed entry placeholder for textvariables and added test_entry_placeholder.py
This commit is contained in:
@ -12,7 +12,7 @@ def checkbox_event():
|
||||
print("checkbox_event")
|
||||
|
||||
txt_var = tkinter.StringVar(value="")
|
||||
entry_1 = customtkinter.CTkEntry(app, width=200, textvariable=txt_var)
|
||||
entry_1 = customtkinter.CTkEntry(app, width=200, textvariable=txt_var, placeholder_text="placeholder")
|
||||
entry_1.pack(pady=15)
|
||||
txt_var.set("new text test")
|
||||
if TEST_CONFIGURE: entry_1.configure(textvariable=txt_var)
|
||||
|
27
test/manual_integration_tests/text_entry_placeholder.py
Normal file
27
test/manual_integration_tests/text_entry_placeholder.py
Normal file
@ -0,0 +1,27 @@
|
||||
import customtkinter
|
||||
|
||||
app = customtkinter.CTk() # create CTk window like you do with the Tk window (you can also use normal tkinter.Tk window)
|
||||
app.geometry("400x400")
|
||||
app.title("test_entry_placeholder.py")
|
||||
|
||||
str_var = customtkinter.StringVar(value="test")
|
||||
|
||||
entry_1 = customtkinter.CTkEntry(app, placeholder_text="placeholder", textvariable=str_var)
|
||||
entry_1.pack(pady=20)
|
||||
|
||||
entry_2 = customtkinter.CTkEntry(app, placeholder_text="placeholder", textvariable=str_var)
|
||||
entry_2.pack(pady=20)
|
||||
entry_2.insert(0, "sdfjk ")
|
||||
entry_2.delete(0, 2)
|
||||
|
||||
entry_3 = customtkinter.CTkEntry(app, placeholder_text="placeholder")
|
||||
entry_3.pack(pady=(40, 20))
|
||||
entry_3.insert(0, "sdfjk")
|
||||
entry_3.delete(0, "end")
|
||||
|
||||
entry_4 = customtkinter.CTkEntry(app, placeholder_text="password", show="*")
|
||||
entry_4.pack(pady=(20, 20))
|
||||
entry_4.insert(0, "sdfjk")
|
||||
entry_4.delete(0, 2)
|
||||
|
||||
app.mainloop()
|
Reference in New Issue
Block a user