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

Function build_graph

recipes/Python/502216_Boids_Demonstration/recipe-502216.py:25–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 build_graph()
24
25def build_graph():
26 # Build GUI environment.
27 global graph
28 root = Tk()
29 root.overrideredirect(True)
30 root.geometry('%dx%d+%d+%d' % (WIDTH, HEIGHT, (root.winfo_screenwidth() - WIDTH) / 2, (root.winfo_screenheight() - HEIGHT) / 2))
31 root.bind_all('<Escape>', lambda event: event.widget.quit())
32 graph = Canvas(root, width=WIDTH, height=HEIGHT, background='white')
33 graph.after(40, update)
34 graph.pack()
35
36def update():
37 # Main simulation loop.

Callers 1

initialiseFunction · 0.70

Calls 4

TkClass · 0.50
quitMethod · 0.45
afterMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected