MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Method __init__

recipes/Python/576705_pyGTK_threading/recipe-576705.py:12–27  ·  view source on GitHub ↗
(self, threads=None)

Source from the content-addressed store, hash-verified

10
11class 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:

Callers 1

__init__Method · 0.45

Calls 6

rangeFunction · 0.85
ProgressThreadClass · 0.85
set_titleMethod · 0.80
connectMethod · 0.45
appendMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected