I'm writing my first GUI program with Tkinter (first program in Python too, actually).
I have an Entry widget for searching, and the results go to a Listbox. I want the results to update as the user types, so I made a callback like this:
search_field.bind("<KeyRelease>", update_results)
The problem is that updates the search many times in a row. Since the results will be coming from a database query, that generates a lot of unnecessary traffic. What I really want is for it to update every second or so, or to wait a second after the user stops typing and then search. What's the easiest way to do that? Thanks
UPDATE: That works great for what I described, but now I've realized that I also need to trigger an update after the user stops typing. Otherwise, the last few characters are never included in the search. I think I have to un-accept the answer in order for this to go back into the list of questions...