X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2FmatitaGui.ml;h=c1bdfcc77f0d46fc5a4b7e0c20d42a901761ba3c;hb=2026624f827b29c35d54aa67b301250123ea7311;hp=26cf9df086cacdd54511d0ded7bb5dab02fa40b0;hpb=e35ec00b1be70e4b064b74a49735b37b5e719e5b;p=helm.git diff --git a/helm/matita/matitaGui.ml b/helm/matita/matitaGui.ml index 26cf9df08..c1bdfcc77 100644 --- a/helm/matita/matitaGui.ml +++ b/helm/matita/matitaGui.ml @@ -23,24 +23,6 @@ * http://helm.cs.unibo.it/ *) -(* -class stringListModel' uriChoiceDialog = - let tree_view = uriChoiceDialog#uriChoiceTreeView in - let column_list = new GTree.column_list in - let text_column = column_list#add Gobject.Data.string in - let list_store = GTree.list_store column_list in - let renderer = (GTree.cell_renderer_text [], ["text", text_column]) in - let view_column = GTree.view_column ~renderer () in - let _ = tree_view#set_model (Some (list_store :> GTree.model)) in - let _ = tree_view#append_column view_column in - object - method append s = - let tree_iter = list_store#append () in - list_store#set ~row:tree_iter ~column:text_column s - method clear () = list_store#clear () - end -*) - open Printf open MatitaGeneratedGui @@ -53,12 +35,10 @@ class gui file = let main = new mainWin ~file () in 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 script = new scriptWin ~file () in let keyBindingBoxes = (* event boxes which should receive global key events *) - [ toolbar#toolBarEventBox; proof#proofWinEventBox; main#mainWinEventBox; - check#checkWinEventBox; script#scriptWinEventBox; main#consoleEventBox ] + [ toolbar#toolBarEventBox; main#mainWinEventBox; + script#scriptWinEventBox; main#consoleEventBox ] in let console = MatitaConsole.console ~evbox:main#consoleEventBox @@ -80,17 +60,21 @@ class gui file = (* 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 check; c script ]); - (* "global" key bindings *) - List.iter (fun (key, callback) -> self#addKeyBinding key callback) + [ c about; c fileSel; c main; c toolbar; c script ]); + (* key bindings *) + List.iter (* global key bindings *) + (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; - GdkKeysyms._F5, +*) + [ GdkKeysyms._F5, toggle_win ~check:main#showScriptMenuItem script#scriptWin; GdkKeysyms._x, (fun () -> console#toggle ()); ]; + add_key_binding GdkKeysyms._Escape console#hide main#consoleEventBox; (* about win *) ignore (about#aboutWin#event#connect#delete (fun _ -> true)); ignore (main#aboutMenuItem#connect#activate (fun _ -> @@ -117,8 +101,10 @@ class gui file = (* script *) (* menus *) toggle_visibility toolbar#toolBarWin main#showToolBarMenuItem; +(* toggle_visibility proof#proofWin main#showProofMenuItem; toggle_visibility check#checkWin main#showCheckMenuItem; +*) toggle_visibility script#scriptWin main#showScriptMenuItem; List.iter (fun w -> w#misc#set_sensitive false) [ main#saveMenuItem; main#saveAsMenuItem ]; @@ -126,23 +112,24 @@ class gui file = ignore (main#showConsoleMenuItem#connect#activate console#toggle); (* main *) connect_button main#hideConsoleButton console#hide; -(* (* console *) 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 - method proof = proof method script = script method toolbar = toolbar + method newBrowserWin () = + let win = new browserWin ~file () in + win#check_widgets (); + win + method newUriDialog () = let dialog = new uriChoiceDialog ~file () in dialog#check_widgets (); @@ -208,7 +195,6 @@ class gui file = end -let instance = - let gui = lazy (new gui (Helm_registry.get "matita.glade_file")) in - fun () -> Lazy.force gui +let gui () = new gui (Helm_registry.get "matita.glade_file") +let instance = singleton gui