gobject.timeout_add(100, self.timeout)

def timeout(self):
    self.val += 1
self.scale.set_value(self.val)
return True
if __name__ == '__main__':
    win = gtk.Window()
win.set_default_size(300, 50)
win.connect('destroy', gtk.main_quit)
bar = Bar(win)
win.show_all()
gtk.main()
Periodically call a function in pygtk's main loop