in
aux
+let choose_selection mmlwidget (element : Gdome.element option) =
+ let rec aux element =
+ if element#hasAttributeNS
+ ~namespaceURI:Misc.helmns
+ ~localName:(Gdome.domString "xref")
+ then
+ mmlwidget#set_selection (Some element)
+ else
+ try
+ match element#get_parentNode with
+ | None -> assert false
+ | Some p -> aux (new Gdome.element_of_node p)
+ with GdomeInit.DOMCastException _ ->
+ debug_print "trying to select above the document root"
+ in
+ match element with
+ | Some x -> aux x
+ | None -> mmlwidget#set_selection None
+
class proof_viewer obj =
object(self)
prerr_endline (gdome_elt#get_nodeName#to_string);
ignore (self#action_toggle gdome_elt)
| None -> ()));
- (* bugfix: until mapping gtkmathview doesn't draw anything *)
- ignore (self#misc#connect#after#map (fun _ ->
- match current_mathml with
- | None -> ()
- | Some mathml -> self#load_root ~root:mathml#get_documentElement))
+ ignore (self#connect#selection_changed (choose_selection self))
method load_proof ((uri_opt, _, _, _) as proof, (goal_opt: int option)) =
let (annobj, ids_to_terms, ids_to_father_ids, ids_to_inner_sorts,
inherit GMathViewAux.multi_selection_math_view obj
+ initializer
+ ignore (self#connect#selection_changed (choose_selection self))
+
val mutable current_infos = None
method get_selected_terms =
let win metano =
let w =
GBin.scrolled_window ~hpolicy:`AUTOMATIC ~vpolicy:`AUTOMATIC
- ~show:true ()
+ ~shadow_type:`IN ~show:true ()
in
let reparent () =
match sequent_viewer#misc#parent with
notebook#append_page ~tab_label:(tab_label metano) (win metano))
metasenv;
switch_page_callback <-
- Some (notebook#connect#after#switch_page ~callback:(fun page ->
+ Some (notebook#connect#switch_page ~callback:(fun page ->
let goal =
try
List.assoc page page2goal
let proof_viewer_instance =
let instance = lazy (
let gui = MatitaGui.instance () in
- let frame =
- GBin.frame ~packing:(gui#proof#scrolledProof#add_with_viewport)
- ~show:true ()
- in
- proof_viewer ~show:true ~packing:(frame#add) ()
+ proof_viewer ~show:true ~packing:gui#proof#scrolledProof#add ()
) in
fun () -> Lazy.force instance