diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 1999-11-16 10:22:42 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 1999-11-16 10:22:42 +0000 |
commit | 9696d300803ab6fcb5ab2884cd65fe05696e7025 (patch) | |
tree | 82e406c747a89199f5d8a74b161da42aa00fdeb9 /otherlibs/labltk/browser/main.ml | |
download | ocaml-labltk.tar.gz |
import labltklabltk
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/labltk@2531 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/labltk/browser/main.ml')
-rw-r--r-- | otherlibs/labltk/browser/main.ml | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/otherlibs/labltk/browser/main.ml b/otherlibs/labltk/browser/main.ml new file mode 100644 index 0000000000..681342cff5 --- /dev/null +++ b/otherlibs/labltk/browser/main.ml @@ -0,0 +1,34 @@ +(* $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))) + errmsg:"lablbrowser :"; + 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; + + let top = openTkClass "LablBrowser" in + 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 |