开发者

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜