I was trying to build a simple stopwatch app using py-gtk. Here is the callback function for the toggle button in my stopwatch window.
def start(self,widget):
if widget.get_active():
widget.set_label('Stop')
else:
self.entry.set_text(str(time.time() - s))
widget.set_label('Start')
It works perfectly well except for the fact that time does not get continuously get displayed in the entry widget. If I add an infinite while loop inside the 'If ' condition like ,
while 1:
self.entry.set_text(str(time.time() - s))
the window becomes unresponsive. Can someone help?