I have a table made of multiple entries in tkinter. When I change one entry I want to update all others. I have achieved this by binding all entries with a <FocusOut>
function that refreshes the table. This works fines as long as I do not focus from one entry to another.
What works: I click on one entry, I type what I want, I click somewhere else in the window (except another entry) and everything updates fine. I can continue on.
What doesn't: I click on one entry, I type what I want and I click on another entry. This updates the table, but I can not type anything nor click on any other entry as long as I do not click first on a 'non entry' part of the frame. As if the
<FocusOut>
bound prevented me from focusing in to the next one.
I would like to either:
- keep track of the next entry I click on in order to
focus_force()
it after the refresh has run. - or solve this problem with any other welcome suggestion.
Here is a simplified version of my code:
entries = {}
def table_refresh():
for y, name in zip(list_y, list_names):
insertion = "some value that is function of the other entries"
entries[name] = tk.Entry(master)
entries[name].place(x=x, y=y)
entries[name].insert(0, insertion)
entries[name].configure(**entry_params)
entries[name].bind("<FocusOut>", on_focusout)
def on_focusout(event):
table_refresh()