Código Python:
Ver original
#!/urs/bin/env python import pygtk, gtk import gobject import os gobject.threads_init() class Timer(): def __init__(self): self.g = 0 self.Win() def start_t(self, widget): self.g = gobject.timeout_add(100 , self.count) def count(self): self.systema = os.system('ls -R /') self.pbar.pulse() return True def Win(self): self.win = gtk.Window() self.win.set_size_request(500, 50) self.win.connect("destroy", lambda q: gtk.main_quit()) self.box1 = gtk.HBox() self.win.add(self.box1) self.box1.show() self.label = gtk.Label("Listar Sistema") self.box1.pack_start(self.label) self.label.show() self.button1 = gtk.Button("aceptar") self.box1.pack_start(self.button1) self.button1.show() self.button1.connect("clicked",self.start_t) self.pbar = gtk.ProgressBar() self.box1.pack_start(self.pbar) self.pbar.show() self.win.show() def main(): gtk.main() if __name__=="__main__": window = Timer() main()