python - How do I get an event callback when a Tkinter Entry widget is modified? -


exactly question says. text widgets have <<modified>> event, entry widgets don't appear to.

add tkinter stringvar entry widget. bind callback stringvar using trace method.

from tkinter import *  def callback(sv):     print sv.get()  root = tk() sv = stringvar() sv.trace("w", lambda name, index, mode, sv=sv: callback(sv)) e = entry(root, textvariable=sv) e.pack() root.mainloop()   

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -