I am trying to create a keybind for my Entry
, which takes what the user has inputted into the Entry
and then calls a function.
My code:
def nameValidation(name):
if PresenceCheck(name) and LengthCheck(name,2) and DataTypeCheck(name,str):
print("Valid Name")
else:
nameEntry.configure(bg="red")
nameEntry = tk.Entry(root,textvariable=nameInput,bg="white",font=("Arial",28))
nameEntry.grid(row=2,column=2)
nameEntry.bind("<FocusOut>",nameValidation(nameInput.get()))
When I run the code, the Entry
is coloured red, indicating the function has been called, even though the keybind was not activated.