view tests/dynClass.ur @ 1690:a7b70c7b3f1a

Avoid 'not fully determined' errors for fancy tasks
author Adam Chlipala <adam@chlipala.net>
date Sat, 03 Mar 2012 16:20:54 -0500
parents b0720700c36e
children acadf9d1214a
line wrap: on
line source
style s1
style s2

fun main () : transaction page =
    src <- source s1;
    s <- source "";
    toggle <- source False;
    return <xml>
      <head>
	<link rel="stylesheet" type="text/css" href="http://localhost/test.css"/>
      </head>
      <body>
	<button dynClass={signal src} onclick={set src s2}/>

	<hr/>

	<ctextbox source={s} dynClass={t <- signal toggle;
				       return (if t then s1 else s2)}
        	  onkeyup={fn _ => t <- get toggle; set toggle (not t)}/>
      </body>
    </xml>