cooking up small example with view-bind-many
This commit is contained in:
parent
46c0ba5b7e
commit
55b74e277b
17
web-world/examples/color-buttons/color-buttons.rkt
Normal file
17
web-world/examples/color-buttons/color-buttons.rkt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#lang planet dyoo/whalesong
|
||||||
|
|
||||||
|
(require (planet dyoo/whalesong/web-world))
|
||||||
|
|
||||||
|
(define-resource view.html)
|
||||||
|
|
||||||
|
(define bound-view
|
||||||
|
(view-bind-many view.html
|
||||||
|
["red-button" "click" click]
|
||||||
|
["white-button" "click" click]
|
||||||
|
["blue-button" "click" click]
|
||||||
|
["orange-button" "click" click]
|
||||||
|
["green-button" "click" click]
|
||||||
|
["black-button" "click" click]))
|
||||||
|
|
||||||
|
|
||||||
|
(big-bang (initial-view bound-view)
|
13
web-world/examples/color-buttons/view.html
Normal file
13
web-world/examples/color-buttons/view.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>This is a header</h1>
|
||||||
|
<input id="red-button" value="Red">
|
||||||
|
<input id="white-button" value="White">
|
||||||
|
<input id="blue-button" value="Blue">
|
||||||
|
<input id="orange-button" value="Orange">
|
||||||
|
<input id="green-button" value="Green">
|
||||||
|
<input id="black-button" value="Black">
|
||||||
|
<body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user