comparison tests/focus.ur @ 1785:ffd7ed3bc0b7

Basis.giveFocus
author Adam Chlipala <adam@chlipala.net>
date Sat, 21 Jul 2012 11:59:41 -0400
parents
children
comparison
equal deleted inserted replaced
1784:e6bc6bbd7a32 1785:ffd7ed3bc0b7
1 fun main () : transaction page =
2 id1 <- fresh;
3 id2 <- fresh;
4 s1 <- source "";
5 s2 <- source "";
6 which <- source False;
7
8 return <xml><body>
9 <ctextbox id={id1} source={s1}/>
10 <ctextbox id={id2} source={s2}/>
11 <button onclick={fn _ => w <- get which;
12 set which (not w);
13 giveFocus (if w then id1 else id2)}/>
14 </body></xml>