summaryrefslogtreecommitdiff
path: root/tests/focus.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-07-21 11:59:41 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2012-07-21 11:59:41 -0400
commita8e63939847f6fb02b2dc030adca09e554adb89f (patch)
tree13683afe5e2e162dec21d810da31708f220d3fb5 /tests/focus.ur
parentda2141fbf28e6173f587ee146acc8f78b7ea8e0d (diff)
Basis.giveFocus
Diffstat (limited to 'tests/focus.ur')
-rw-r--r--tests/focus.ur14
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>