aboutsummaryrefslogtreecommitdiff
path: root/ide/command_windows.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ide/command_windows.ml')
-rw-r--r--ide/command_windows.ml27
1 files changed, 14 insertions, 13 deletions
diff --git a/ide/command_windows.ml b/ide/command_windows.ml
index f442eac2b8..d202f42fb0 100644
--- a/ide/command_windows.ml
+++ b/ide/command_windows.ml
@@ -75,31 +75,32 @@ object(self)
let result = GText.view ~packing:r_bin#add () in
result#misc#set_can_focus false;
result#set_editable false;
+ let callback () =
+ let phrase = combo#entry#text ^ " " ^ entry#text ^" . " in
+ try
+ ignore(Coq.interp phrase);
+ result#buffer#set_text (Ideutils.read_stdout ())
+ with e ->
+ let (s,loc) = Coq.process_exn e in
+ assert (Glib.Utf8.validate s);
+ result#buffer#set_text s
+ in
+
begin match command,term with
| None,None -> ()
| Some c, None ->
- combo#entry#set_text c
+ combo#entry#set_text c;
| Some c, Some t ->
combo#entry#set_text c;
entry#set_text t
-
+
| None , Some t ->
entry#set_text t
end;
+ callback ();
entry#misc#grab_focus ();
entry#misc#grab_default ();
-
- let callback () =
- let phrase = combo#entry#text ^ " " ^ entry#text ^" . " in
- try
- ignore(Coq.interp phrase);
- result#buffer#set_text (Ideutils.read_stdout ())
- with e ->
- let (s,loc) = Coq.process_exn e in
- assert (Glib.Utf8.validate s);
- result#buffer#set_text s
- in
ignore (entry#connect#activate ~callback);
ignore (combo#entry#connect#activate ~callback);
self#window#present ()