From 36b7e77057e093f7e2d599d8ad8ad0c7cef84867 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 29 Jul 2013 18:44:54 -0400 Subject: Update example code in README. --- README.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index e207635..693cb6f 100644 --- a/README.org +++ b/README.org @@ -42,9 +42,11 @@ (define (render) (draw-sprite sprite)) - ;; Register callbacks. - (set-render-callback (lambda () (render))) - (set-key-down-callback (lambda (key) (key-down key))) + ;; Register hooks. Lambdas are used as "trampolines" so that render + ;; and key-down can be redefined later and the hooks will call the + ;; updated procedures. + (add-hook! on-render-hook (lambda () (render))) + (add-hook! on-key-down-hook (lambda (key) (key-down key))) ;; Open the window. (open-window window-width window-height) -- cgit v1.2.3