[Tkinter] text widget update problem

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Fri Nov 29 05:16:35 EST 2002


On Thu, 2002-11-28 at 10:01, Thomas Rademacher wrote:
> Hallo,
> 
> I want to write a text widget which can be filled step by step in dependent
> on program sequence:
> ...
> scrollbar = Scrollbar(frameMsg, orient=VERTICAL)
> scrollbar.pack(fill=Y, side=RIGHT)
> text = Text(frameMsg, bd=0,font='courier 8', width=960, height=450,
> fg="black")
> text.pack()
> text.config(yscrollcommand=scrollbar.set)
> scrollbar.config(command=text.yview)
> ...
> 
> The input of the text widget I create in a singleton logger class:
> ...
> Logging.__msgHandle.insert(END, logString)
> Logging.__msgHandle.update()  <--
> ...
> 
> I want to see the the output step by step during program sequence. But I
> have following problems:
> 1. With Logging.__msgHandle.update() I get a program crash when all lines in
> the widget filled. The widget does not show the following messages.
> 2. Without  Logging.__msgHandle.update() I get the my program output at the
> end of the program and not step by step.
> 
> How can I resolve the problem? Who has any ideas? It is a singleton class
> problem?
> Thank's for your hints, Thomas
> 
> 

Are you calling update() from the main thread (you don't mention threads
but I am guessing you are using them)  Could you post a cut down version
that demonstrates the problem?  I have had problems with calling
update() from another thread.....



Cheers
Martin






More information about the Python-list mailing list