comparison tests/activeFocus.ur @ 1790:56b8efff64e7

Nicer <active> semantics
author Adam Chlipala <adam@chlipala.net>
date Sun, 22 Jul 2012 09:42:17 -0400
parents
children
comparison
equal deleted inserted replaced
1789:2e01a36701eb 1790:56b8efff64e7
1 fun main () : transaction page =
2 i <- fresh;
3 return <xml><body>
4 <ctextbox/>
5 <ctextbox id={i}/>
6 <active code={giveFocus i; return <xml>Done</xml>}/>
7 </body></xml>
8
9 fun dynamic () : transaction page =
10 x <- source <xml/>;
11 return <xml><body>
12 <dyn signal={signal x}/>
13 <button onclick={fn _ => i <- fresh; set x <xml>
14 <ctextbox/>
15 <ctextbox id={i}/>
16 <active code={giveFocus i; return <xml>Done</xml>}/>
17 </xml>}/>
18 </body></xml>