[Tutor] Tkinter entry box text changed event

Phil phil_lor at bigpond.com
Mon Apr 10 00:43:30 EDT 2017


Again, thank you for reading this.

I would like a function to be called when I enter text and then tab to the next entry box. I've been trying to follow the answers to similar questions in Stack Overflow but I've become hopelessly confused because of the different answers given to seemingly the same question.

I have created a row of entry boxes and a matching function like this:

for i in range(8):
    self.numbers[i]= Entry(master, width=4, justify=CENTER, foreground="gray")
    self.numbers[i].grid(row=16, column=i)
    self.numbers[i].bind('StringVar()', self.my_function)

def my_function(event):
	print("function called")

The function is not called and I know that the binding of the function to the entry boxes is not the correct method. What am I missing?

-- 
Regards,
Phil


More information about the Tutor mailing list