Statement orders

David Murmann david.murmann at rwth-aachen.de
Sun Oct 2 14:39:57 EDT 2005


Fredrik Lundh wrote:
> Monu Agrawal wrote:
> 
>> Hi I am making a gui based tool. When user preses a perticular button I
>> am running a heavy command, before this I want to say user to wait with
>> a image showing infront of her.
>>
>> My code is like:
>>
>> def loadData(self):
>>    top=Toplevel(self.parent)
>>    top.focus_set()
>>    self.parent.wm_title("Loading Data...")
> 
> +    top.update() # flush the event queue
> 
>>    os.system('a heavy command')
>>    os.system('another heavy command)
>>    top.destroy()
> 
> </F>

I had a very similar problem and adding an update call solved it, but
in some tk documentation i read that one should be careful with adding
update calls to callbacks and prefer update_idletasks. in my case the
update method is even called one time before the mainloop is entered,
yet everything seems to work fine, so exactly when is it dangerous to
call update? (or is it dangerous at all?)

David.



More information about the Python-list mailing list