view tests/dynClass.ur @ 1968:2c075e875a47

Fix a subtle renaming problem in elaborating functor applications
author Adam Chlipala <adam@chlipala.net>
date Fri, 14 Feb 2014 15:11:22 -0500
parents acadf9d1214a
children 2b2d07946e65
line wrap: on
line source
style date
style topic

fun main () : transaction page =
    toggle <- source False;
    return <xml>
      <head>
	<link rel="stylesheet" type="text/css" href="http://adam.chlipala.net/style.css"/>
      </head>
      <body>
	<button dynClass={b <- signal toggle;
                          return (if b then date else topic)}
                dynStyle={b <- signal toggle;
                          return (if b then
                                      STYLE "width: 500px"
                                  else
                                      STYLE "width: 200px")}
                onclick={b <- get toggle; set toggle (not b)}/>

        <button dynStyle={b <- signal toggle;
                          return (if b then
                                      STYLE "width: 200px"
                                  else
                                      STYLE "width: 100px")}/>
        <button dynClass={b <- signal toggle;
                          return (if b then
                                      topic
                                  else
                                      date)}/>
      </body>
    </xml>