My Tkinter application has to receive events from a TCP connection. I
have chosen to do this in the following manner:
The TCP communication takes place in a separate thread. When I receive
data, I generate an event in the Python application thus:
app.event_gener ate("<<myevent1 >>")
In the associated event handler, I do this:
self.label1.gri d_forget()
self.label2.gri d()
This works well if event is generated from a function that is called
through the after() method of the main frame. But when I send the event
from my TCP thread, the system hangs in the call to grid_forget.
Surprisingly, if I replace self.label1.gri d_forget() with
self.label1.des troy(), things work well.
What can I do to call grid_forget in this event handler?
--
Claus Tondering
have chosen to do this in the following manner:
The TCP communication takes place in a separate thread. When I receive
data, I generate an event in the Python application thus:
app.event_gener ate("<<myevent1 >>")
In the associated event handler, I do this:
self.label1.gri d_forget()
self.label2.gri d()
This works well if event is generated from a function that is called
through the after() method of the main frame. But when I send the event
from my TCP thread, the system hangs in the call to grid_forget.
Surprisingly, if I replace self.label1.gri d_forget() with
self.label1.des troy(), things work well.
What can I do to call grid_forget in this event handler?
--
Claus Tondering
Comment