-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathabout_window.ml
77 lines (68 loc) · 2.44 KB
/
about_window.ml
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
(*
* prooftree --- proof tree display for Proof General
*
* Copyright (C) 2011 - 2024 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/>.
*)
(** 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 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 ()