3
rated 0 times
[
3]
[
0]
/ answers: 1 / hits: 704
/ 3 Years ago, wed, may 26, 2021, 8:53:46
I am developing a multithreaded application in pygtk using quickly and stuck with threads. So I am experimenting with various possibilities and found out that my thread work only when I do something in the gui Here is my code
t = threading.Thread(target=self.calc,args=(treeiter))
t.daemon = True
t.start()
def calc(self,treeiter):
store=self.builder.get_object('liststore1')
per=0
while 1:
print "Calcing and changing percent,per="+str(per)
tore.set_value(treeiter,4,str(int(per))+"%")
per+=1
time.sleep(1)
I am trying to update the value in a liststore
by thread but it only get update when I click some button or some other gui events why is that so? why is the thread not running in the background?
More From » application-development