File: calendar.ml

package info (click to toggle)
lablgtk2 2.6.0-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,032 kB
  • ctags: 5,191
  • sloc: ml: 27,719; ansic: 7,662; makefile: 532; sh: 83
file content (21 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(* $Id: calendar.ml,v 1.3 2000/04/24 09:07:21 garrigue Exp $ *)

open GMain

let main () =
  let window = GWindow.window () in
  window#connect#destroy ~callback:Main.quit;

  let calendar = GMisc.calendar ~packing:window#add () in
  calendar#connect#day_selected ~callback:
    begin fun () ->
      let (year,month,day) = calendar#date in
      Printf.printf "You selected %d/%d/%02d.\n"
	day (month+1) (year mod 100);
      flush stdout
    end;

  window#show ();
  Main.main ()

let _ = main ()