How can I make sure the content of a tkinter entry is saved on FocusOut?
<p>I have an app that uses <code>&lt;FocusOut&gt;</code> binding to automatically save the edits in an <code>Entry</code> to a list.</p>

<p>There is no problem saving the <code>Entry</code> text when using <code>TAB</code> to navigate through the Entries or when I click on another Entry, but If I change the text on one Entry and then if I mouse-click on a <code>ListBox</code> in another frame, <code>&lt;FocusOut&gt;</code> doesn't work on the last selected Entry and the information in it is not registered. </p>

<p>How can I avoid this without resorting to a <code>Save</code> button on the GUI? For every selection in the <code>ListBox</code> there are different <code>Entry</code> boxes, so the user would have to press the <code>Save</code> button numerous times. I would like to avoid that.</p>

<h3>Realtime edit / save text instead</h3>

<p>It looks like you want to get the updated text realtime. What I do in such a case is use the <code>'KeyRelease'</code> -binding. Simple, effective enrtry- specific and works instantly.</p>

<p>In concept:</p>

<pre class="lang-py prettyprint-override"><code>win = Tk()
def dosomething(*args):
    # update the corresponding text anywhere, save your text, whatever
    print(entry.get())

entry = Entry()
entry.bind("&lt;KeyRelease&gt;", dosomething)
entry.pack()

win.mainloop()
</code></pre>

<p><a href="https://i.stack.imgur.com/oDHl1.png" rel="nofollow"><img src="https://i.stack.imgur.com/oDHl1.png" alt="enter image description here"></a></p>

<p>In action:</p>

<pre class="lang-none prettyprint-override"><code>M
Mo
Mon
Monk
Monke
Monkey
Monkey 
Monkey e
Monkey ea
Monkey eat
Monkey eats
Monkey eats 
Monkey eats b
Monkey eats ban
Monkey eats ban
Monkey eats bana
Monkey eats banan
Monkey eats banana
</code></pre>

python tkinter entry focusout