File: about_window.ml

package info (click to toggle)
prooftree 0.13-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid, stretch
  • size: 592 kB
  • ctags: 668
  • sloc: ml: 4,462; sh: 117; makefile: 111
file content (79 lines) | stat: -rw-r--r-- 2,577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
(* 
 * prooftree --- proof tree display for Proof General
 * 
 * Copyright (C) 2011 - 2016 Hendrik Tews
 * 
 * This file is part of "prooftree".
 * 
 * "prooftree" is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * "prooftree" is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License in file COPYING in this or one of the parent
 * directories for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with "prooftree". If not, see <http://www.gnu.org/licenses/>.
 * 
 * $Id: about_window.ml,v 1.7 2016/01/23 12:57:13 tews Exp $
 *)


(** Creation and display of the about window *)


(** Reference for the about window to ensure there is maximal one
    about window.
*)
let about_window = ref None

(** Delete and destroy the about window. *)
let delete_about () =
  match !about_window with
    | None -> ()
    | Some about ->
      about#destroy ();
      about_window := None

(** Hook for the response signal, which gets emitted when the "Close"
    button is hit. The "Close" button actually delivers a [`CANCEL],
    resulting in the about dialog being destroyed.
*)
let about_button = function
  | `CANCEL -> delete_about ()
  | _ -> ()


(** Text for the about dialog. *)
let about_comment =
  "Prooftree displays proof trees for Coq and HOL Light under control of \
   the Proof General user interface. Prooftree has been developed by \
   Hendrik Tews and is published under GPL version 3. For more information \
   visit http://askra.de/software/prooftree/."

(** Show the about window. If necessary, create one and connect all
    the signals. This is the hook for the "About" main menu entry. 
*)
let show_about_window () =
  match !about_window with
    | Some about -> about#present ()
    | None ->
      let about = 
	GWindow.about_dialog 
	  ~name:"Prooftree"
	  ~comments:about_comment
	  ~copyright:("Prooftree version " ^ Version.version 
		      ^ " © Hendrik Tews")
	  (* ~website_label:string -> *)
	  (* ~parent:#window_skel -> *)
	  (* ~destroy_with_parent:bool -> *)
	  () 
      in
      about_window := Some about;
      ignore(about#connect#destroy ~callback:delete_about);
      ignore(about#connect#response ~callback:about_button);
      about#show ()