X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2FmatitaGui.ml;h=212e4e4d9b1a2e4b62547203a69dc1b3949b2fef;hb=1e61e4290c96600e3758b30b660712514ba379e3;hp=2018d7176210f8b4cbc9b2bfbf40aa903436610b;hpb=4cf419a2e770f4971be7b03b1d73e585d973dc1b;p=helm.git diff --git a/helm/matita/matitaGui.ml b/helm/matita/matitaGui.ml index 2018d7176..212e4e4d9 100644 --- a/helm/matita/matitaGui.ml +++ b/helm/matita/matitaGui.ml @@ -41,6 +41,8 @@ class stringListModel' uriChoiceDialog = end *) +open Printf + open MatitaGeneratedGui open MatitaGtkMisc @@ -51,23 +53,31 @@ class gui file = let about = new aboutWin ~file () in let fileSel = new fileSelectionWin ~file () in let proof = new proofWin ~file () in + let check = new checkWin ~file () in let keyBindingBoxes = (* event boxes which should receive global key events *) - [ toolbar#toolBarEventBox; proof#proofWinEventBox ] + [ toolbar#toolBarEventBox; proof#proofWinEventBox; main#mainWinEventBox; + check#checkWinEventBox ] + in + let console = + MatitaConsole.console ~evbox:main#consoleEventBox + ~packing:main#scrolledConsole#add () in - let console = MatitaConsole.console ~packing:main#scrolledConsole#add () in object (self) initializer (* glade's check widgets *) List.iter (fun w -> w#check_widgets ()) (let c w = (w :> unit>) in - [ c about; c fileSel; c main; c proof; c toolbar ]); + [ c about; c fileSel; c main; c proof; c toolbar; c check ]); (* show/hide commands *) toggle_visibility toolbar#toolBarWin main#showToolBarMenuItem; toggle_visibility proof#proofWin main#showProofMenuItem; + toggle_visibility check#checkWin main#showCheckMenuItem; (* "global" key bindings *) List.iter (fun (key, callback) -> self#addKeyBinding key callback) [ GdkKeysyms._F3, toggle_win ~check:main#showProofMenuItem proof#proofWin; + GdkKeysyms._F4, + toggle_win ~check:main#showCheckMenuItem check#checkWin; ]; (* about win *) ignore (about#aboutWin#event#connect#delete (fun _ -> true)); @@ -75,16 +85,20 @@ class gui file = about#aboutWin#show ())); ignore (about#aboutDismissButton#connect#clicked (fun _ -> about#aboutWin#misc#hide ())); + about#aboutLabel#set_label (Pcre.replace ~pat:"@VERSION@" + ~templ:BuildTimeConf.version about#aboutLabel#label); (* menus *) List.iter (fun w -> w#misc#set_sensitive false) [ main#saveMenuItem; main#saveAsMenuItem ]; main#helpMenu#set_right_justified true; (* console *) - console#echo_message "\tMatita version 0.0.1\n"; + console#echo_message (sprintf "\tMatita version %s\n" + BuildTimeConf.version); console#echo_prompt (); console#misc#grab_focus () method about = about + method check = check method console = console method fileSel = fileSel method main = main @@ -124,3 +138,7 @@ class gui file = end +let instance = + let gui = lazy (new gui (Helm_registry.get "matita.glade_file")) in + fun () -> Lazy.force gui +