From 3c0f17f82bfa1b8b12ea52c6b1aa55ca45dbdcdd 2011-09-13 07:20:42 From: Nicolas Rougier Date: 2011-09-13 07:20:42 Subject: [PATCH] Added the close handler --- diff --git a/docs/examples/lib/gui-pyglet.py b/docs/examples/lib/gui-pyglet.py index 0ef06b4..3bdb699 100644 --- a/docs/examples/lib/gui-pyglet.py +++ b/docs/examples/lib/gui-pyglet.py @@ -18,6 +18,10 @@ label = pyglet.text.Label('Hello, world', x=window.width//2, y=window.height//2, anchor_x='center', anchor_y='center') @window.event +def on_close(): + window.close() + +@window.event def on_draw(): window.clear() label.draw()