diff examples/datebox.ur @ 14:0827320b0f04

Write calendarCtl in terms of a source with a listener.
author Karn Kallio <kkallio@eka>
date Fri, 05 Aug 2011 18:55:24 -0430
parents bbdedfde154e
children 8300d5f0dc19
line wrap: on
line diff
--- a/examples/datebox.ur	Thu Jul 28 11:51:10 2011 -0430
+++ b/examples/datebox.ur	Fri Aug 05 18:55:24 2011 -0430
@@ -2,12 +2,14 @@
 
 tm <- now;
 
-dayCtl <- Datebox.createCalendarCtl tm;
+dayCtl <- Datebox.create tm;
+
+load <- return (Datebox.addListener (fn d => alert (show d.Day)) dayCtl);
 
 return
     <xml>
       <head><title>Datebox Example</title></head>
-      <body>
-        {Datebox.renderCalendarCtl (fn (d : Datebox.date) => alert (show d.Year)) dayCtl}
+      <body onload={load}>
+        {Datebox.render dayCtl}
       </body>
     </xml>