diff examples/togglepanel.ur @ 20:554e342665fe

Add a new parameter to Gui.gui
author Adam Chlipala <adam@chlipala.net>
date Sat, 24 Sep 2011 15:47:00 -0400
parents 90be8b8917d5
children 93140c5cc972
line wrap: on
line diff
--- a/examples/togglepanel.ur	Fri Sep 23 13:30:01 2011 +0200
+++ b/examples/togglepanel.ur	Sat Sep 24 15:47:00 2011 -0400
@@ -4,14 +4,15 @@
 val defaultContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Default format</b></p></xml>
 val otherContent : xbody = <xml><p>Here I am inside the panel.<br/><b>Other format</b></p></xml>
 
-val otherFormat = {FormatPanel = fn ctl panel => <xml><span>A Custom {ctl} Format</span>{panel}</xml>,
-                   OpenCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>View</a></xml>,
-                   CloseCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>Hide</a></xml>}
+val otherFormat = fn [body ~ []] =>
+                     {FormatPanel = fn ctl panel => <xml><span>A Custom {ctl} Format</span>{panel}</xml>,
+                      OpenCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>View</a></xml>,
+                      CloseCtl = fn behaviour => <xml><a href={bless "http://#"} onclick={behaviour}>Hide</a></xml>}
 
 fun main () =
 
-    defaultFormatPanel <- create defaultFormat defaultContent True;
-    otherFormatPanel <- create otherFormat otherContent False;
+    defaultFormatPanel <- create @defaultFormat defaultContent True;
+    otherFormatPanel <- create @otherFormat otherContent False;
 
     return <xml>
       <head>