let (|>) x f = f x (* (for OCaml < 4.01) *) let manual () = print_endline "Manual chosen..." let automatic () = print_endline "Automatic chosen..." let () = let dialog = GWindow.dialog ~title:"Partitioning" () in GMisc.label ~packing:(dialog#vbox#pack ~expand:true) ~text:"Automatic or manual?" () |> ignore; dialog#add_button "Cancel" `CANCEL; dialog#add_button "Manual" `MANUAL; dialog#add_button "Automatic" `AUTOMATIC; dialog#connect#response ~callback:(function | `AUTOMATIC -> automatic () | `MANUAL -> manual () | `CANCEL | `DELETE_EVENT -> GMain.Main.quit () ) |> ignore; dialog#show (); GMain.Main.main ()