I am using python with gtk. I want to download a file, and while this is happening i draw an animated gif on the window. But everytime the download starts, the gif is freezing. I thought the gobject call should fix this, but seems not like.
The call is:
in the gui class
...
gobject.timeout_add(3000, self.load)
gtk.main()
and the load function:
def load(self):
ul = urllib2.open('http://xxxx/')
data = ul.read()
while gtk.events_pending():
gtk.main_iteration()
return True
with every call of load the gui stacks. Any way to do that better?
original code:
self.opener = urllib2.build_opener()
self.opener.addheaders.append(('Cookie', self.cookie))
self.state = self.opener.open('http://'+gd_adress+'/state.cst?Lang=en')
self.state_data = self.state.read()