From 46c0ba5b7e0be9f675aedbfaf524e381a943ba42 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Mon, 13 Feb 2012 11:20:52 -0500 Subject: [PATCH] changing dwarves-with-remove to use view-bind-many* --- scribblings/manual.scrbl | 1 + .../dwarves-with-remove/dwarves-with-remove.rkt | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scribblings/manual.scrbl b/scribblings/manual.scrbl index 3ba264ba..43dd0c11 100644 --- a/scribblings/manual.scrbl +++ b/scribblings/manual.scrbl @@ -963,6 +963,7 @@ Common event types include @racket["click"], @racket["mouseenter"], or @racket["change"].} Note that the name of each event should not include an @racket["on"] prefix. + As an example: @codeblock|{ (define (click-handler w v) ...) diff --git a/web-world/examples/dwarves-with-remove/dwarves-with-remove.rkt b/web-world/examples/dwarves-with-remove/dwarves-with-remove.rkt index 941e1376..de7dddf7 100644 --- a/web-world/examples/dwarves-with-remove/dwarves-with-remove.rkt +++ b/web-world/examples/dwarves-with-remove/dwarves-with-remove.rkt @@ -43,12 +43,10 @@ ;; The first view consists of index.html. We attach event handlers ;; to each name here. (define my-view - (foldl (lambda (name view) - (view-bind (view-focus view name) - "click" - hide-on-click)) - (->view index.html) - dwarf-names)) + (view-bind-many* (->view index.html) + (map (lambda (name) + (list name "click" hide-on-click)) + dwarf-names))) (big-bang dwarf-names