]> matita.cs.unibo.it Git - helm.git/blob - helm/DEVEL/lablgtk/lablgtk_20000829-0.1.0/examples/old/hello.ml
Initial revision
[helm.git] / helm / DEVEL / lablgtk / lablgtk_20000829-0.1.0 / examples / old / hello.ml
1 (* $Id$ *)
2
3 open GtkBase
4 open GtkButton
5 open GtkWindow
6 open GtkMain
7
8 let window = Window.create `TOPLEVEL
9
10 let button = Button.create label:"Hello World"
11
12 let main () =
13   GtkSignal.connect sig:Widget.Signals.Event.delete window
14     callback:(fun _ -> prerr_endline "Delete event occured"; true);
15   GtkSignal.connect sig:Object.Signals.destroy window callback:Main.quit;
16   Container.set_border_width window 10;
17   GtkSignal.connect sig:Button.Signals.clicked button
18     callback:(fun () -> prerr_endline "Hello World"; Object.destroy window);
19   Container.add window button;
20   Widget.show_all window;
21   Main.main ()
22
23 let _ = Printexc.print main ()