1999-11-30 06:59:39 -08:00
|
|
|
(* $Id$ *)
|
|
|
|
|
|
|
|
open Tk
|
|
|
|
|
|
|
|
let _ =
|
|
|
|
let path = ref [] in
|
|
|
|
Arg.parse
|
|
|
|
keywords:[ "-I", Arg.String (fun s -> path := s :: !path),
|
|
|
|
"<dir> Add <dir> to the list of include directories" ]
|
|
|
|
others:(fun name -> raise(Arg.Bad("don't know what to do with " ^ name)))
|
1999-12-10 07:50:53 -08:00
|
|
|
errmsg:"ocamlbrowser :";
|
1999-11-30 06:59:39 -08:00
|
|
|
Config.load_path := List.rev !path @ [Config.standard_library];
|
|
|
|
begin
|
|
|
|
try Searchid.start_env := Env.open_pers_signature "Pervasives" Env.initial
|
|
|
|
with Env.Error _ -> ()
|
|
|
|
end;
|
|
|
|
|
|
|
|
Searchpos.view_defined_ref := Viewer.view_defined;
|
|
|
|
Searchpos.editor_ref.contents <- Editor.f;
|
|
|
|
|
1999-12-15 08:54:08 -08:00
|
|
|
let top = openTk class:"OCamlBrowser" () in
|
1999-11-30 06:59:39 -08:00
|
|
|
Jg_config.init ();
|
|
|
|
|
|
|
|
bind top events:[[], `Destroy] action:(`Set ([], fun _ -> exit 0));
|
|
|
|
at_exit Shell.kill_all;
|
|
|
|
|
|
|
|
|
|
|
|
Viewer.f on:top ();
|
|
|
|
|
|
|
|
while true do
|
|
|
|
try
|
|
|
|
Printexc.print mainLoop ()
|
|
|
|
with Protocol.TkError _ -> ()
|
|
|
|
done
|