labltkではなくてlablgtk2を使ってみる
let hello () =
print_endline "Hello World";
flush stdout
let delete_event ev =
print_endline "Delete event occurred";
flush stdout;
true
let destroy () = GMain.Main.quit ()
let main () =
let window = GWindow.window ~border_width:10 () in
window#event#connect#delete ~callback:delete_event;
window#connect#destroy ~callback:destroy;
let button = GButton.button ~label:"Hello World" ~packing:window#add () in
button#connect#clicked ~callback:hello;
button#connect#clicked ~callback:window#destroy;
window#show ();
GMain.Main.main ()
let _ = main ()