diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-07-21 11:59:41 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-07-21 11:59:41 -0400 |
commit | 6ee57363d23e05fd783d8b7d151a249c0efdcd23 (patch) | |
tree | 13683afe5e2e162dec21d810da31708f220d3fb5 /tests | |
parent | 84a14ca026a8ca7ed4488e51506340b249809fae (diff) |
Basis.giveFocus
Diffstat (limited to 'tests')
-rw-r--r-- | tests/focus.ur | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/focus.ur b/tests/focus.ur new file mode 100644 index 00000000..9d1f5b8c --- /dev/null +++ b/tests/focus.ur @@ -0,0 +1,14 @@ +fun main () : transaction page = + id1 <- fresh; + id2 <- fresh; + s1 <- source ""; + s2 <- source ""; + which <- source False; + + return <xml><body> + <ctextbox id={id1} source={s1}/> + <ctextbox id={id2} source={s2}/> + <button onclick={fn _ => w <- get which; + set which (not w); + giveFocus (if w then id1 else id2)}/> + </body></xml> |