Codebase list coq / 202cab27-8a94-44fc-a179-d95ab0c9a980/main ide / coqide_QUARTZ.ml.in
202cab27-8a94-44fc-a179-d95ab0c9a980/main

Tree @202cab27-8a94-44fc-a179-d95ab0c9a980/main (Download .tar.gz)

coqide_QUARTZ.ml.in @202cab27-8a94-44fc-a179-d95ab0c9a980/mainraw · history · blame

(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *         Copyright INRIA, CNRS and contributors             *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)

let osx = GosxApplication.osxapplication ()

let () =
  let _ = osx#connect#ns_application_open_file
    ~callback:(fun x -> Coqide.do_load x; true)
  in
  let _ = osx#connect#ns_application_block_termination
    ~callback:Coqide.forbid_quit
  in
  let _ = osx#connect#ns_application_will_terminate
    ~callback:Coqide.close_and_quit
  in ()

let init () =
  let () = GtkosxApplication.Application.set_menu_bar osx#as_osxapplication
    (GtkMenu.MenuShell.cast
       (Coqide_ui.ui_m#get_widget "/CoqIde MenuBar")#as_widget)
  in
  let () = GtkosxApplication.Application.insert_app_menu_item
    osx#as_osxapplication
    (Coqide_ui.ui_m#get_widget "/CoqIde MenuBar/Edit/Prefs")#as_widget 1
  in
  let () = GtkosxApplication.Application.set_help_menu osx#as_osxapplication
    (Some (GtkMenu.MenuItem.cast
             (Coqide_ui.ui_m#get_widget "/CoqIde MenuBar/Help")#as_widget))
  in
  osx#ready ()