+ ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
+ let scrolled_window =
+ GBin.scrolled_window ~border_width:10
+ ~packing:(vbox#pack ~expand:true ~padding:5) () in
+ let sequent_viewer =
+ TermViewer.sequent_viewer
+ ~packing:(scrolled_window#add) ~width:400 ~height:280 () in
+object(self)
+ val mutable term = Cic.Rel 1 (* dummy value *)
+ val mutable context = ([] : Cic.context) (* dummy value *)
+ val mutable metasenv = ([] : Cic.metasenv) (* dummy value *)
+ method sequent_viewer = sequent_viewer
+ method show () = window#misc#hide () ; window#show ()
+ method term = term
+ method set_term t = term <- t
+ method context = context
+ method set_context t = context <- t
+ method metasenv = metasenv
+ method set_metasenv t = metasenv <- t
+ initializer
+ ignore
+ (sequent_viewer#connect#selection_changed (choose_selection sequent_viewer));
+ ignore(window#event#connect#delete (fun _ -> window#misc#hide () ; true )) ;
+ ignore(whdb#connect#clicked InvokeTactics'.whd_in_scratch) ;
+ ignore(reduceb#connect#clicked InvokeTactics'.reduce_in_scratch) ;
+ ignore(simplb#connect#clicked InvokeTactics'.simpl_in_scratch)
+end;;
+
+let open_contextual_menu_for_selected_terms mmlwidget infos =
+ let button = GdkEvent.Button.button infos in
+ let terms_selected = List.length mmlwidget#get_selections > 0 in
+ if button = 3 then
+ begin
+ let time = GdkEvent.Button.time infos in
+ let menu = GMenu.menu () in
+ let f = new GMenu.factory menu in
+ let whd_menu_item =
+ f#add_item "Whd" ~key:GdkKeysyms._W ~callback:InvokeTactics'.whd in
+ let reduce_menu_item =
+ f#add_item "Reduce" ~key:GdkKeysyms._R ~callback:InvokeTactics'.reduce in
+ let simpl_menu_item =
+ f#add_item "Simpl" ~key:GdkKeysyms._S ~callback:InvokeTactics'.simpl in
+ let _ = f#add_separator () in
+ let generalize_menu_item =
+ f#add_item "Generalize"
+ ~key:GdkKeysyms._G ~callback:InvokeTactics'.generalize in
+ let _ = f#add_separator () in
+ let clear_menu_item =
+ f#add_item "Clear" ~key:GdkKeysyms._C ~callback:InvokeTactics'.clear in
+ let clearbody_menu_item =
+ f#add_item "ClearBody"
+ ~key:GdkKeysyms._B ~callback:InvokeTactics'.clearbody
+ in
+ whd_menu_item#misc#set_sensitive terms_selected ;
+ reduce_menu_item#misc#set_sensitive terms_selected ;
+ simpl_menu_item#misc#set_sensitive terms_selected ;
+ generalize_menu_item#misc#set_sensitive terms_selected ;
+ clear_menu_item#misc#set_sensitive terms_selected ;
+ clearbody_menu_item#misc#set_sensitive terms_selected ;
+ menu#popup ~button ~time
+ end ;
+ true
+;;
+
+class page () =
+ let vbox1 = GPack.vbox () in
+object(self)
+ val mutable proofw_ref = None
+ val mutable compute_ref = None
+ method proofw =
+ Lazy.force self#compute ;
+ match proofw_ref with
+ None -> assert false
+ | Some proofw -> proofw
+ method content = vbox1
+ method compute =
+ match compute_ref with
+ None -> assert false
+ | Some compute -> compute
+ initializer
+ compute_ref <-
+ Some (lazy (
+ let scrolled_window1 =
+ GBin.scrolled_window ~border_width:10
+ ~packing:(vbox1#pack ~expand:true ~padding:5) () in
+ let proofw =
+ TermViewer.sequent_viewer ~width:400 ~height:275
+ ~packing:(scrolled_window1#add) () in
+ let _ = proofw_ref <- Some proofw in
+ let hbox3 =
+ GPack.hbox ~packing:(vbox1#pack ~expand:false ~fill:false ~padding:5) () in
+ let ringb =
+ GButton.button ~label:"Ring"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+ let fourierb =
+ GButton.button ~label:"Fourier"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+ let reflexivityb =
+ GButton.button ~label:"Reflexivity"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+ let symmetryb =
+ GButton.button ~label:"Symmetry"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+ let assumptionb =
+ GButton.button ~label:"Assumption"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+ let contradictionb =
+ GButton.button ~label:"Contradiction"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+ let hbox4 =
+ GPack.hbox ~packing:(vbox1#pack ~expand:false ~fill:false ~padding:5) () in
+ let existsb =
+ GButton.button ~label:"Exists"
+ ~packing:(hbox4#pack ~expand:false ~fill:false ~padding:5) () in
+ let splitb =
+ GButton.button ~label:"Split"
+ ~packing:(hbox4#pack ~expand:false ~fill:false ~padding:5) () in
+ let leftb =
+ GButton.button ~label:"Left"
+ ~packing:(hbox4#pack ~expand:false ~fill:false ~padding:5) () in
+ let rightb =
+ GButton.button ~label:"Right"
+ ~packing:(hbox4#pack ~expand:false ~fill:false ~padding:5) () in
+ let searchpatternb =
+ GButton.button ~label:"SearchPattern_Apply"
+ ~packing:(hbox4#pack ~expand:false ~fill:false ~padding:5) () in
+ let hbox5 =
+ GPack.hbox ~packing:(vbox1#pack ~expand:false ~fill:false ~padding:5) () in
+ let exactb =
+ GButton.button ~label:"Exact"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let introsb =
+ GButton.button ~label:"Intros"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let applyb =
+ GButton.button ~label:"Apply"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let elimintrossimplb =
+ GButton.button ~label:"ElimIntrosSimpl"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let elimtypeb =
+ GButton.button ~label:"ElimType"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let foldwhdb =
+ GButton.button ~label:"Fold_whd"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let foldreduceb =
+ GButton.button ~label:"Fold_reduce"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let hbox6 =
+ GPack.hbox ~packing:(vbox1#pack ~expand:false ~fill:false ~padding:5) () in
+ let foldsimplb =
+ GButton.button ~label:"Fold_simpl"
+ ~packing:(hbox6#pack ~expand:false ~fill:false ~padding:5) () in
+ let cutb =
+ GButton.button ~label:"Cut"
+ ~packing:(hbox6#pack ~expand:false ~fill:false ~padding:5) () in
+ let changeb =
+ GButton.button ~label:"Change"
+ ~packing:(hbox6#pack ~expand:false ~fill:false ~padding:5) () in
+ let letinb =
+ GButton.button ~label:"Let ... In"
+ ~packing:(hbox6#pack ~expand:false ~fill:false ~padding:5) () in
+ let rewritesimplb =
+ GButton.button ~label:"RewriteSimpl ->"
+ ~packing:(hbox6#pack ~expand:false ~fill:false ~padding:5) () in
+ let rewritebacksimplb =
+ GButton.button ~label:"RewriteSimpl <-"
+ ~packing:(hbox6#pack ~expand:false ~fill:false ~padding:5) () in
+ let hbox7 =
+ GPack.hbox ~packing:(vbox1#pack ~expand:false ~fill:false ~padding:5) () in
+ let absurdb =
+ GButton.button ~label:"Absurd"
+ ~packing:(hbox7#pack ~expand:false ~fill:false ~padding:5) () in
+ let decomposeb =
+ GButton.button ~label:"Decompose"
+ ~packing:(hbox7#pack ~expand:false ~fill:false ~padding:5) () in
+ let transitivityb =
+ GButton.button ~label:"Transitivity"
+ ~packing:(hbox7#pack ~expand:false ~fill:false ~padding:5) () in
+ let replaceb =
+ GButton.button ~label:"Replace"
+ ~packing:(hbox7#pack ~expand:false ~fill:false ~padding:5) () in
+ let injectionb =
+ GButton.button ~label:"Injection"
+ ~packing:(hbox7#pack ~expand:false ~fill:false ~padding:5) () in
+ let discriminateb =
+ GButton.button ~label:"Discriminate"
+ ~packing:(hbox7#pack ~expand:false ~fill:false ~padding:5) () in
+(* Zack: spostare in una toolbar
+ let generalizeb =
+ GButton.button ~label:"Generalize"
+ ~packing:(hbox7#pack ~expand:false ~fill:false ~padding:5) () in
+ let clearbodyb =
+ GButton.button ~label:"ClearBody"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let clearb =
+ GButton.button ~label:"Clear"
+ ~packing:(hbox5#pack ~expand:false ~fill:false ~padding:5) () in
+ let whdb =
+ GButton.button ~label:"Whd"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+ let reduceb =
+ GButton.button ~label:"Reduce"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+ let simplb =
+ GButton.button ~label:"Simpl"
+ ~packing:(hbox3#pack ~expand:false ~fill:false ~padding:5) () in
+*)
+
+ ignore(exactb#connect#clicked InvokeTactics'.exact) ;
+ ignore(applyb#connect#clicked InvokeTactics'.apply) ;
+ ignore(elimintrossimplb#connect#clicked InvokeTactics'.elimintrossimpl) ;
+ ignore(elimtypeb#connect#clicked InvokeTactics'.elimtype) ;
+ ignore(foldwhdb#connect#clicked InvokeTactics'.fold_whd) ;
+ ignore(foldreduceb#connect#clicked InvokeTactics'.fold_reduce) ;
+ ignore(foldsimplb#connect#clicked InvokeTactics'.fold_simpl) ;
+ ignore(cutb#connect#clicked InvokeTactics'.cut) ;
+ ignore(changeb#connect#clicked InvokeTactics'.change) ;
+ ignore(letinb#connect#clicked InvokeTactics'.letin) ;
+ ignore(ringb#connect#clicked InvokeTactics'.ring) ;
+ ignore(fourierb#connect#clicked InvokeTactics'.fourier) ;
+ ignore(rewritesimplb#connect#clicked InvokeTactics'.rewritesimpl) ;
+ ignore(rewritebacksimplb#connect#clicked InvokeTactics'.rewritebacksimpl) ;
+ ignore(replaceb#connect#clicked InvokeTactics'.replace) ;
+ ignore(reflexivityb#connect#clicked InvokeTactics'.reflexivity) ;
+ ignore(symmetryb#connect#clicked InvokeTactics'.symmetry) ;
+ ignore(transitivityb#connect#clicked InvokeTactics'.transitivity) ;
+ ignore(existsb#connect#clicked InvokeTactics'.exists) ;
+ ignore(splitb#connect#clicked InvokeTactics'.split) ;
+ ignore(leftb#connect#clicked InvokeTactics'.left) ;
+ ignore(rightb#connect#clicked InvokeTactics'.right) ;
+ ignore(assumptionb#connect#clicked InvokeTactics'.assumption) ;
+ ignore(absurdb#connect#clicked InvokeTactics'.absurd) ;
+ ignore(contradictionb#connect#clicked InvokeTactics'.contradiction) ;
+ ignore(introsb#connect#clicked InvokeTactics'.intros) ;
+ ignore(decomposeb#connect#clicked InvokeTactics'.decompose) ;
+ ignore(searchpatternb#connect#clicked searchPattern) ;
+ ignore(injectionb#connect#clicked InvokeTactics'.injection) ;
+ ignore(discriminateb#connect#clicked InvokeTactics'.discriminate) ;
+(* Zack: spostare in una toolbar
+ ignore(whdb#connect#clicked whd) ;
+ ignore(reduceb#connect#clicked reduce) ;
+ ignore(simplb#connect#clicked simpl) ;
+ ignore(clearbodyb#connect#clicked clearbody) ;
+ ignore(clearb#connect#clicked clear) ;
+ ignore(generalizeb#connect#clicked generalize) ;
+*)
+ ignore(proofw#connect#selection_changed (choose_selection proofw)) ;
+ ignore
+ ((new GObj.event_ops proofw#as_widget)#connect#button_press
+ (open_contextual_menu_for_selected_terms proofw)) ;
+ ))
+end
+;;
+
+class empty_page =
+ let vbox1 = GPack.vbox () in
+ let scrolled_window1 =
+ GBin.scrolled_window ~border_width:10
+ ~packing:(vbox1#pack ~expand:true ~padding:5) () in
+ let proofw =
+ TermViewer.sequent_viewer ~width:400 ~height:275
+ ~packing:(scrolled_window1#add) () in
+object(self)
+ method proofw = (assert false : TermViewer.sequent_viewer)
+ method content = vbox1
+ method compute = (assert false : unit)
+end
+;;
+
+let empty_page = new empty_page;;
+
+class notebook =
+object(self)
+ val notebook = GPack.notebook ()
+ val pages = ref []
+ val mutable skip_switch_page_event = false
+ val mutable empty = true
+ method notebook = notebook
+ method add_page n =
+ let new_page = new page () in
+ empty <- false ;
+ pages := !pages @ [n,lazy (setgoal n),new_page] ;
+ notebook#append_page
+ ~tab_label:((GMisc.label ~text:("?" ^ string_of_int n) ())#coerce)
+ new_page#content#coerce
+ method remove_all_pages ~skip_switch_page_event:skip =
+ if empty then
+ notebook#remove_page 0 (* let's remove the empty page *)
+ else
+ List.iter (function _ -> notebook#remove_page 0) !pages ;
+ pages := [] ;
+ skip_switch_page_event <- skip
+ method set_current_page ~may_skip_switch_page_event n =
+ let (_,_,page) = List.find (function (m,_,_) -> m=n) !pages in
+ let new_page = notebook#page_num page#content#coerce in
+ if may_skip_switch_page_event && new_page <> notebook#current_page then
+ skip_switch_page_event <- true ;
+ notebook#goto_page new_page
+ method set_empty_page =
+ empty <- true ;
+ pages := [] ;
+ notebook#append_page
+ ~tab_label:((GMisc.label ~text:"No proof in progress" ())#coerce)
+ empty_page#content#coerce
+ method proofw =
+ let (_,_,page) = List.nth !pages notebook#current_page in
+ page#proofw
+ initializer
+ ignore
+ (notebook#connect#switch_page
+ (function i ->
+ let skip = skip_switch_page_event in
+ skip_switch_page_event <- false ;
+ if not skip then
+ try
+ let (metano,setgoal,page) = List.nth !pages i in
+ set_proof_engine_goal (Some metano) ;
+ Lazy.force (page#compute) ;
+ Lazy.force setgoal;
+ if notify_hbugs_on_goal_change then
+ Hbugs.notify ()
+ with _ -> ()
+ ))
+end
+;;
+
+let dump_environment () =
+ try
+ let oc = open_out environmentfile in
+ output_html (outputhtml ()) (`Msg (`T "Dumping environment ..."));
+ CicEnvironment.dump_to_channel
+ ~callback:(fun uri -> output_html (outputhtml ()) (`Msg (`T uri)))
+ oc;
+ output_html (outputhtml ()) (`Msg (`T "... done!")) ;
+ close_out oc
+ with exc ->
+ output_html (outputhtml ())
+ (`Error (`T (Printf.sprintf "Dump failure, uncaught exception:%s"
+ (Printexc.to_string exc))))
+;;
+let restore_environment () =
+ try
+ let ic = open_in environmentfile in
+ output_html (outputhtml ()) (`Msg (`T "Restoring environment ... "));
+ CicEnvironment.restore_from_channel
+ ~callback:(fun uri -> output_html (outputhtml ()) (`Msg (`T uri)))
+ ic;
+ output_html (outputhtml ()) (`Msg (`T "... done!"));
+ close_in ic
+ with exc ->
+ output_html (outputhtml ())
+ (`Error (`T (Printf.sprintf "Restore failure, uncaught exception:%s"
+ (Printexc.to_string exc))))
+;;
+
+(* Main window *)
+
+class rendering_window output (notebook : notebook) =
+ let scratch_window = new scratch_window in
+ let window =
+ GWindow.window
+ ~title:"gTopLevel - Helm's Proof Assistant"
+ ~border_width:0 ~allow_shrink:false () in
+ let vbox_for_menu = GPack.vbox ~packing:window#add () in
+ (* menus *)
+ let handle_box = GBin.handle_box ~border_width:2
+ ~packing:(vbox_for_menu#pack ~padding:0) () in
+ let menubar = GMenu.menu_bar ~packing:handle_box#add () in
+ let factory0 = new GMenu.factory menubar in
+ let accel_group = factory0#accel_group in
+ (* file menu *)
+ let file_menu = factory0#add_submenu "File" in
+ let factory1 = new GMenu.factory file_menu ~accel_group in
+ (* let export_to_postscript_menu_item = *)
+ let _ =
+ begin
+ let _ =
+ factory1#add_item "New Block of (Co)Inductive Definitions..."
+ ~key:GdkKeysyms._B ~callback:new_inductive
+ in
+ let _ =
+ factory1#add_item "New Proof or Definition..." ~key:GdkKeysyms._N
+ ~callback:new_proof
+ in
+ let reopen_menu_item =
+ factory1#add_item "Reopen a Finished Proof..." ~key:GdkKeysyms._R
+ ~callback:open_
+ in
+ let qed_menu_item =
+ factory1#add_item "Qed" ~key:GdkKeysyms._E ~callback:qed in
+ ignore (factory1#add_separator ()) ;
+ ignore
+ (factory1#add_item "Load Unfinished Proof..." ~key:GdkKeysyms._L
+ ~callback:load_unfinished_proof) ;
+ let save_menu_item =
+ factory1#add_item "Save Unfinished Proof" ~key:GdkKeysyms._S
+ ~callback:save_unfinished_proof
+ in
+ ignore (factory1#add_separator ()) ;
+ ignore (factory1#add_item "Clear Environment" ~callback:CicEnvironment.empty);
+ ignore (factory1#add_item "Dump Environment" ~callback:dump_environment);
+ ignore
+ (factory1#add_item "Restore Environment" ~callback:restore_environment);
+ ignore
+ (save_set_sensitive := function b -> save_menu_item#misc#set_sensitive b);
+ ignore (!save_set_sensitive false);
+ ignore (qed_set_sensitive:=function b -> qed_menu_item#misc#set_sensitive b);
+ ignore (!qed_set_sensitive false);
+ ignore (factory1#add_separator ()) ;
+ (*
+ let export_to_postscript_menu_item =
+ factory1#add_item "Export to PostScript..."
+ ~callback:(export_to_postscript output) in
+ *)
+ ignore (factory1#add_separator ()) ;
+ ignore
+ (factory1#add_item "Exit" ~key:GdkKeysyms._Q ~callback:GMain.Main.quit) (*;
+ export_to_postscript_menu_item *)
+ end in
+ (* edit menu *)
+ let edit_menu = factory0#add_submenu "Edit Current Proof" in
+ let factory2 = new GMenu.factory edit_menu ~accel_group in
+ let focus_and_proveit_set_sensitive = ref (function _ -> assert false) in
+ let proveit_menu_item =
+ factory2#add_item "Prove It" ~key:GdkKeysyms._I
+ ~callback:(function () -> proveit ();!focus_and_proveit_set_sensitive false)
+ in
+ let focus_menu_item =
+ factory2#add_item "Focus" ~key:GdkKeysyms._F
+ ~callback:(function () -> focus () ; !focus_and_proveit_set_sensitive false)
+ in
+ let _ =
+ focus_and_proveit_set_sensitive :=
+ function b ->
+ proveit_menu_item#misc#set_sensitive b ;
+ focus_menu_item#misc#set_sensitive b
+ in
+ let _ = !focus_and_proveit_set_sensitive false in
+ (* edit term menu *)
+ let edit_term_menu = factory0#add_submenu "Edit Term" in
+ let factory5 = new GMenu.factory edit_term_menu ~accel_group in
+ let check_menu_item =
+ factory5#add_item "Check Term" ~key:GdkKeysyms._C
+ ~callback:(check scratch_window) in
+ let _ = check_menu_item#misc#set_sensitive false in
+ (* search menu *)
+ let search_menu = factory0#add_submenu "Search" in
+ let factory4 = new GMenu.factory search_menu ~accel_group in
+ let _ =
+ factory4#add_item "Locate..." ~key:GdkKeysyms._T
+ ~callback:locate in
+ let searchPattern_menu_item =
+ factory4#add_item "SearchPattern..." ~key:GdkKeysyms._D
+ ~callback:completeSearchPattern in
+ let _ = searchPattern_menu_item#misc#set_sensitive false in
+ let show_menu_item =
+ factory4#add_item "Show..." ~key:GdkKeysyms._H ~callback:show
+ in
+ let insert_query_item =
+ factory4#add_item "Insert Query (Experts Only)..." ~key:GdkKeysyms._Y
+ ~callback:insertQuery in
+ (* hbugs menu *)
+ let hbugs_menu = factory0#add_submenu "HBugs" in
+ let factory6 = new GMenu.factory hbugs_menu ~accel_group in
+ let _ =
+ factory6#add_check_item
+ ~active:false ~key:GdkKeysyms._F5 ~callback:Hbugs.toggle "HBugs enabled"
+ in
+ let _ =
+ factory6#add_item ~key:GdkKeysyms._Return ~callback:Hbugs.notify
+ "(Re)Submit status!"
+ in
+ let _ = factory6#add_separator () in
+ let _ =
+ factory6#add_item ~callback:Hbugs.start_web_services "Start Web Services"
+ in
+ let _ =
+ factory6#add_item ~callback:Hbugs.stop_web_services "Stop Web Services"
+ in
+ (* settings menu *)
+ let settings_menu = factory0#add_submenu "Settings" in
+ let factory3 = new GMenu.factory settings_menu ~accel_group in
+ let _ =
+ factory3#add_item "Edit Aliases..." ~key:GdkKeysyms._A
+ ~callback:edit_aliases in
+ let _ = factory3#add_separator () in
+ let _ =
+ factory3#add_item "MathML Widget Preferences..." ~key:GdkKeysyms._P
+ ~callback:(function _ -> (settings_window ())#show ()) in
+ let _ = factory3#add_separator () in
+ let _ =
+ factory3#add_item "Reload Stylesheets"
+ ~callback:
+ (function _ ->
+ ChosenTransformer.reload_stylesheets () ;
+ if ProofEngine.get_proof () <> None then
+ try
+ refresh_goals notebook ;
+ refresh_proof output
+ with
+ InvokeTactics.RefreshSequentException e ->
+ output_html (outputhtml ())
+ (`Error (`T ("An error occurred while refreshing the " ^
+ "sequent: " ^ Printexc.to_string e))) ;
+ (*notebook#remove_all_pages ~skip_switch_page_event:false ;*)
+ notebook#set_empty_page
+ | InvokeTactics.RefreshProofException e ->
+ output_html (outputhtml ())
+ (`Error (`T ("An error occurred while refreshing the proof: " ^ Printexc.to_string e))) ;
+ output#unload
+ ) in
+ (* accel group *)
+ let _ = window#add_accel_group accel_group in
+ (* end of menus *)
+ let hbox0 =
+ GPack.hbox
+ ~packing:(vbox_for_menu#pack ~expand:true ~fill:true ~padding:5) () in
+ let vbox =
+ GPack.vbox ~packing:(hbox0#pack ~expand:true ~fill:true ~padding:5) () in
+ let scrolled_window0 =
+ GBin.scrolled_window ~border_width:10
+ ~packing:(vbox#pack ~expand:true ~padding:5) () in
+ let _ = scrolled_window0#add output#coerce in
+ let frame =
+ GBin.frame ~label:"Insert Term"
+ ~packing:(vbox#pack ~expand:true ~fill:true ~padding:5) () in
+ let scrolled_window1 =
+ GBin.scrolled_window ~border_width:5
+ ~packing:frame#add () in
+ let inputt =
+ TexTermEditor'.term_editor
+ mqi_handle
+ ~width:400 ~height:100 ~packing:scrolled_window1#add ()
+ ~isnotempty_callback:
+ (function b ->
+ check_menu_item#misc#set_sensitive b ;
+ searchPattern_menu_item#misc#set_sensitive b) in
+ let vboxl =
+ GPack.vbox ~packing:(hbox0#pack ~expand:true ~fill:true ~padding:5) () in
+ let _ =
+ vboxl#pack ~expand:true ~fill:true ~padding:5 notebook#notebook#coerce in
+ let frame =
+ GBin.frame ~shadow_type:`IN ~packing:(vboxl#pack ~expand:true ~padding:5) ()
+ in