(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* Coq.tried_tactic) (on_click:unit -> unit) = let root_iter = try Hashtbl.find roots root with Not_found -> let nr = new_arg root in Hashtbl.add roots root nr; nr in let nt = new_tac root_iter name in let old_val = try MyMap.find root tbl with Not_found -> MyMap.empty in tbl <- MyMap.add root (MyMap.add name (nt,compute,on_click) old_val) tbl method clear () = model#clear (); tbl <- MyMap.empty; Hashtbl.clear roots; method blaster () = view#expand_all (); try MyMap.iter (fun root_name l -> try MyMap.iter (fun name (nt,compute,on_click) -> match compute () with | Coq.Interrupted -> prerr_endline "Interrupted"; raise Stop | Coq.Failed -> prerr_endline "Failed"; ignore (model#remove nt) (* model#set ~row:nt ~column:status false; model#set ~row:nt ~column:nb_goals "N/A" *) | Coq.Success n -> prerr_endline "Success"; model#set ~row:nt ~column:status true; model#set ~row:nt ~column:nb_goals (string_of_int n); if n= -1 then raise Done ) l with Done -> ()) tbl; Condition.signal blaster_killed; prerr_endline "End of blaster"; with Stop -> Condition.signal blaster_killed; prerr_endline "End of blaster (stopped !)"; initializer ignore (window#event#connect#delete (fun _ -> window#misc#hide(); true)); ignore (view#selection#connect#after#changed ~callback: begin fun () -> prerr_endline "selection changed"; List.iter (fun path ->let pt = GtkTree.TreePath.to_string path in let it = model#get_iter path in prerr_endline (string_of_bool (model#iter_is_valid it)); let name = model#get ~row:(if String.length pt >1 then begin ignore (GtkTree.TreePath.up path); model#get_iter path end else it ) ~column:argument in let tactic = model#get ~row:it ~column:tactic in prerr_endline ("Got name: "^name); let success = model#get ~row:it ~column:status in if success then try prerr_endline "Got success"; let _,_,f = MyMap.find tactic (MyMap.find name tbl) in f (); (* window#misc#hide () *) with _ -> () ) view#selection#get_selected_rows end); (* needs lablgtk2 update ignore (view#connect#after#row_activated (fun path vcol -> prerr_endline "Activated"; ); *) end let blaster_window = ref None let main n = blaster_window := Some (new blaster_window n) let present_blaster_window () = match !blaster_window with | None -> failwith "No blaster window." | Some c -> c#window#misc#show (* present*) (); c let blaster_window () = match !blaster_window with | None -> failwith "No blaster window." | Some c -> c