From 93b26a7d7cb5f7c86f99589ac740b486c5d51c71 Mon Sep 17 00:00:00 2001 From: pboutill Date: Fri, 10 Jun 2011 18:34:53 +0000 Subject: Menubar and toolbar in coqide using GtkUI & Gactions. You'll need to remove/edit your ~/.coqiderc and ~/.coqide.keys. As it used to be, accelerator modifiers changes are only done after a reboot but we need more binding in lablgtk to improve that... git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14178 85f007b7-540e-0410-9357-904b9bb8a0f7 --- ide/coqide_ui.ml | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 ide/coqide_ui.ml (limited to 'ide/coqide_ui.ml') diff --git a/ide/coqide_ui.ml b/ide/coqide_ui.ml new file mode 100644 index 000000000..0ea018fc4 --- /dev/null +++ b/ide/coqide_ui.ml @@ -0,0 +1,150 @@ +let ui_m = GAction.ui_manager ();; + +let no_under = Minilib.string_map (fun x -> if x = '_' then '-' else x) + +let list_items menu li = + let res_buf = Buffer.create 500 in + let tactic_item = function + |[] -> Buffer.create 1 + |[s] -> let b = Buffer.create 16 in + let () = Buffer.add_string b ("\n") in + b + |s::_ as l -> let b = Buffer.create 50 in + let () = (Buffer.add_string b ("\n")) in + let () = (List.iter + (fun x -> Buffer.add_string b ("\n")) l) in + let () = Buffer.add_string b"\n" in + b in + let () = List.iter (fun b -> Buffer.add_buffer res_buf (tactic_item b)) li in + res_buf + +let init () = + let theui = Printf.sprintf " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %s + + + + + + + + + + + %s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +" + (Buffer.contents (list_items "Tactic" Coq_commands.tactics)) + (Buffer.contents (list_items "Template" Coq_commands.commands)) + in + ignore (ui_m#add_ui_from_string theui); -- cgit v1.2.3