-
Notifications
You must be signed in to change notification settings - Fork 1.1k
CTkEntry
Default theme:
entry = customtkinter.CTkEntry(master=root_tk, placeholder_text="CTkEntry")
entry.pack(padx=20, pady=10)
Customized:
entry = customtkinter.CTkEntry(master=root_tk,
placeholder_text="CTkEntry",
width=120,
height=25,
border_width=2,
corner_radius=10)
entry.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)
argument | value |
---|---|
master | root, tkinter.Frame or CTkFrame |
textvariable | tkinter.StringVar object |
width | entry width in px |
height | entry height in px |
corner_radius | corner radius in px |
fg_color | foreground color, tuple: (light_color, dark_color) or single color or "transparent" |
text_color | entry text color, tuple: (light_color, dark_color) or single color |
placeholder_text_color | tuple: (light_color, dark_color) or single color |
placeholder_text | hint on the entry input (disappears when selected), default is None, don't works in combination with a textvariable |
font | entry text font, tuple: (font_name, size) |
state | "normal" (standard) or "disabled" (not clickable) |
and the following arguments of the tkinter.Entry class:
"exportselection", "insertborderwidth", "insertofftime", "insertontime", "insertwidth", "justify", "selectborderwidth", "show", "takefocus", "validate", "validatecommand", "xscrollcommand"
-
All attributes can be configured and updated.
ctk_entry.configure(state=new_state) ctk_entry.configure(textvariable=textvariable) ...
-
Pass attribute name as string and get current value of attribute.
state = ctk_entry.cget("state") ...
-
Bind command function to event specified by sequence.
-
Deletes characters from the widget, starting with the one at index first_index, up to but not including the character at position last_index. If the second argument is omitted, only the single character at position first is deleted.
-
Inserts string before the character at the given index.
-
Returns current string in the entry.
CustomTkinter by Tom Schimansky 2022
The Github Wiki is outdated, the new documentation can be found at: