let t =
GSourceView.source_view ~auto_indent:false ~editable:false ()
in
- t#source_buffer#insert text;
- w#toplevel#set_title title;
- w#scrolledwinContent#add (t :> GObj.widget);
- ignore(w#buttonSearch#connect#clicked ~callback:( fun () ->
+ let callback () =
let text = w#entrySearch#text in
let highlight start end_ =
t#source_buffer#move_mark `INSERT ~where:start;
(match t#source_buffer#start_iter#forward_search text with
| None -> ()
| Some (start,end_) -> highlight start end_)
- | Some (start,end_) -> highlight start end_));
+ | Some (start,end_) -> highlight start end_
+ in
+ t#source_buffer#insert text;
+ w#toplevel#set_title title;
+ w#scrolledwinContent#add (t :> GObj.widget);
+ ignore(w#entrySearch#connect#activate ~callback);
+ ignore(w#buttonSearch#connect#clicked ~callback);
ignore(w#buttonClose#connect#clicked ~callback:(fun () ->
w#toplevel#misc#hide (); w#toplevel#destroy ()));
w