view tests/dynClass.ur @ 2148:a49c12ddf47d

Handling overflow in integer literals (contributed by Gabriel Riba)
author Adam Chlipala <adam@chlipala.net>
date Thu, 28 May 2015 10:23:43 -0400
parents 2b2d07946e65
children
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={fn _ => 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>