diff datebox.ur @ 19:3a303df9ae92

Partial generalize togglePanel solution (breaks build)
author Ron de Bruijn <rmbruijn@gmail.com>
date Fri, 23 Sep 2011 13:30:01 +0200
parents 8300d5f0dc19
children 554e342665fe
line wrap: on
line diff
--- a/datebox.ur	Thu Sep 22 19:24:01 2011 +0200
+++ b/datebox.ur	Fri Sep 23 13:30:01 2011 +0200
@@ -1,5 +1,5 @@
-type t = {Cal : Calendar.t,
-          Panel : TogglePanel.togglePanel Calendar.t}
+con t other_ctx = {Cal : Calendar.t,
+          Panel : TogglePanel.togglePanel Calendar.t other_ctx}
 
 type date = Calendar.date
 val date_eq = Calendar.date_eq
@@ -7,7 +7,9 @@
 val time = Calendar.time
 val date = Calendar.date
 
-val format = TogglePanel.defaultFormat 
+(* : other_ctx:::{Unit} -> [other_ctx ~ body] => formatCtl other_ctx  *)
+
+val format  = TogglePanel.defaultFormat 
                  --#OpenCtl -- #CloseCtl
                  ++ {OpenCtl = fn behaviour => <xml><button value="Choose" onclick={behaviour}/></xml>,
                      CloseCtl = fn behaviour => <xml><button value="Hide" onclick={behaviour}/></xml>}