let choose_selection rendering_window node =
let module M = Minidom in
- let rec aux ~first_time node =
+ let rec aux node =
match M.node_get_attribute node (M.mDOMString_of_string "xref") with
None ->
let parent =
None -> assert false
| Some parent -> parent
in
- aux ~first_time:false parent
- | Some s ->
- if not first_time then
- !(rendering_window#output)#set_selection (Some node)
+ aux parent
+ | Some s -> !(rendering_window#output)#set_selection (Some node)
in
match node with
- None -> () (* No element selected *)
- | Some node -> aux ~first_time:true node
+ None -> !(rendering_window#output)#set_selection None
+ | Some node -> aux node
;;
GPack.vbox ~packing:window#add () in
let _ = vbox#pack ~expand:false ~fill:false ~padding:5 label#coerce in
let paned =
- GPack.paned `HORIZONTAL ~packing:(vbox#pack ~padding:5) () in
+ GPack.paned `HORIZONTAL ~packing:(vbox#pack ~expand:true ~padding:5) () in
let scrolled_window0 =
GBin.scrolled_window ~border_width:10 ~packing:paned#add1 () in
let _ = scrolled_window0#add !output#coerce in
GMisc.label ~text:"???"
~packing:(vbox#pack ~expand:false ~fill:false ~padding:5) () in
let paned =
- GPack.paned `HORIZONTAL ~packing:(vbox#pack ~padding:5) () in
+ GPack.paned `HORIZONTAL ~packing:(vbox#pack ~expand:true ~padding:5) () in
let scrolled_window0 =
GBin.scrolled_window ~border_width:10 ~packing:paned#add1 () in
let output =