diff tests/event.ur @ 894:a3f58978ff32

Testing new events
author Adam Chlipala <adamc@hcoop.net>
date Sat, 18 Jul 2009 12:37:19 -0400
parents
children ae9e22822ec5
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/event.ur	Sat Jul 18 12:37:19 2009 -0400
@@ -0,0 +1,16 @@
+fun main () =
+    s <- source "";
+    return <xml><body onresize={set s "Resize"}>
+      <button onblur={set s "Blur 1"} onfocus={set s "Focus 1"} onclick={set s "Click 1"}/>
+      <button onblur={set s "Blur 2"} onfocus={set s "Focus 2"} onclick={set s "Click 2"}/>
+      <span onclick={set s "Click"} ondblclick={set s "Double-click"}>SPAN</span>
+      <span onmousedown={set s "Mouse down"} onmouseup={set s "Mouse up"}>SPAN</span>
+      <span onmouseout={set s "Mouse out"} onmouseover={set s "Mouse over"}>SPAN</span>
+      <span onmousemove={set s "Mouse move"}>SPAN</span>
+      <button onkeydown={set s "Key down"} onkeyup={set s "Key up"}/>
+      <button onkeypress={set s "Key press"}/>
+      <br/>
+      <br/>
+
+      <dyn signal={s <- signal s; return <xml>{[s]}</xml>}/>
+    </body></xml>