(self, threads=None)
| 10 | |
| 11 | class PyApp(gtk.Window): |
| 12 | def __init__(self, threads=None): |
| 13 | super(PyApp, self).__init__() |
| 14 | |
| 15 | self.connect("destroy", self.quit) |
| 16 | self.set_title("pyGTK Threads Example") |
| 17 | |
| 18 | vbox = gtk.VBox(False, 4) |
| 19 | |
| 20 | self.threads = [] |
| 21 | for i in range(NUM_THREADS + 1): |
| 22 | pb = gtk.ProgressBar() |
| 23 | vbox.pack_start(pb, False, False, 0) |
| 24 | self.threads.append(ProgressThread(pb, random.uniform(0.01, 0.10))) |
| 25 | |
| 26 | self.add(vbox) |
| 27 | self.show_all() |
| 28 | |
| 29 | def quit(self, obj): |
| 30 | for t in self.threads: |