Tkinter & refreshing windows

Hans Nowak hnowak at cuci.nl
Sun Sep 12 09:52:20 EDT 1999


Hello,

When working with Tkinter I noticed that on certain occasions, Tk 
doesn't refresh the screen until it's done with a certain task. Hmm, 
that doesn't sound very clear. :)  An example: I'm currently working 
on a program that accepts user input, then filters a lot of data 
based on this input, then displays the results. Since the filtering 
took a few seconds, I thought it would be a good idea to display the 
current search results in a listbox while filtering, i.e. for every 
"record" that passed the test, a string is added to the listbox. You 
would be able to see some results while the filtering was still going 
on.

However, that doesn't seem to work at all. The program starts 
executing the filtering, and doesn't display anything until 
everything is done. In fact, trying to change the text of a label, 
directly before the filtering starts, doesn't work either. 

I don't know if this is Windows-related (I'm using Win95 :( ), but 
this is a well-known problem in Delphi, and there you have the 
Refresh() method. Is there a similar method for Tkinter, to force an 
update of the screen display?

TIA,

--Hans Nowak (zephyrfalcon at hvision.nl)
Homepage: http://fly.to/zephyrfalcon
Python Snippets: http://tor.dhs.org/~zephyrfalcon/snippets/
The Purple Kookaburra Forum: http://www.delphi.com/kookaburra/




More information about the Python-list mailing list