Mercurial > gui
comparison 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 |
comparison
equal
deleted
inserted
replaced
13:c016beb0ebac | 14:0827320b0f04 |
---|---|
1 fun main () = | 1 fun main () = |
2 | 2 |
3 tm <- now; | 3 tm <- now; |
4 | 4 |
5 dayCtl <- Datebox.createCalendarCtl tm; | 5 dayCtl <- Datebox.create tm; |
6 | |
7 load <- return (Datebox.addListener (fn d => alert (show d.Day)) dayCtl); | |
6 | 8 |
7 return | 9 return |
8 <xml> | 10 <xml> |
9 <head><title>Datebox Example</title></head> | 11 <head><title>Datebox Example</title></head> |
10 <body> | 12 <body onload={load}> |
11 {Datebox.renderCalendarCtl (fn (d : Datebox.date) => alert (show d.Year)) dayCtl} | 13 {Datebox.render dayCtl} |
12 </body> | 14 </body> |
13 </xml> | 15 </xml> |