diff --git a/src/x11ex.nim b/src/x11ex.nim index d02e460..30839a4 100644 --- a/src/x11ex.nim +++ b/src/x11ex.nim @@ -85,7 +85,10 @@ proc handle_event* (hello: var Hello) = else: discard -var hello = createHello(800, 600, "Hello!") -defer: hello.close() -while hello.running: - hello.handle_event() +proc main = + var hello = createHello(800, 600, "Hello!") + defer: hello.close() + while hello.running: + hello.handle_event() + +main()