summaryrefslogtreecommitdiff
path: root/tests/focus.ur
blob: 9d1f5b8c4a694b30f785f2ef1a513b528675a2e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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>