(************************************************************************) (* * The Rocq Prover / The Rocq Development Team *) (* v * Copyright INRIA, CNRS and contributors *) (* hbox#pack icon#coerce ~padding:4) icon; ignore (GMisc.label ~text:message ~packing:hbox#add ()); (* the function called to create each button by iterating *) let rec iter_buttons pos = function | but_content :: others -> let label, stock = match but_content with | ButtonWithLabel label -> Some label, None | ButtonWithStock stock -> None, Some stock in let but = GButton.button ?label ?stock ~packing:(bbox#pack ~expand:true) () in ignore (but#connect#clicked ~callback:(fun () -> button_nb := pos; window#destroy ())); (* If it's the default button then give it the focus *) if pos = default then but#grab_default (); iter_buttons (pos + 1) others; | [] -> () in iter_buttons 1 buttons; ignore (window#connect#destroy ~callback:GMain.Main.quit); window#set_position `CENTER; window#show (); GMain.Main.main (); !button_nb let message_box ?parent ?icon ~title ?(ok = ButtonWithStock `OK) message = ignore (question_box ?parent ?icon ~title ~buttons:[ ok ] message)