Continuously redraw wxPython element
I have a chat client that continuously polls a server and fetches new messages.
From my def __init__() 开发者_如何学运维I have:
wx.CallAfter(self.pollServer)
Which is defined:
def pollServer(self):
t = self.updateMessages()
time.sleep(5)
self.pollServer()
Now printing the messages into the Terminal shows that it works but the GUI is 'frozen' instead of being continuously refreshed and I thought CallAfter takes care of that. Could you help?
instead of
time.sleep(5)
self.pollServer()
try with
wx.CallLater(5,self.pollServer)
精彩评论