views:

90

answers:

1

Hi, 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?

+2  A: 

instead of

time.sleep(5)
self.pollServer()

try with

wx.CallLater(5,self.pollServer)
S.Mark
AttributeError: 'module' object has no attribute 'CallLater'
Radek
what is your wxPython version btw? its working in mine
S.Mark
and also which OS?
S.Mark
wx.VERSION gives me 2.6.3.2
Radek
using Linux Mint 7
Radek
ah ok, seems like in wx 2.8 its Renamed wx.FutureCall to wx.CallLater, so may be yours is wx.FutureCall http://www.wxpython.org/recentchanges.php
S.Mark
Very, very, good. Thank you :).
Radek
your welcome Radek
S.Mark