X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2FmatitaAutoGui.ml;h=9ba6dd89828052a7e084cc0a42e9ec3e54f3122c;hb=72a91e9bdd1a8c1a3f12522ec9acec4f53afe345;hp=0436c206dbb3827b52b5f083c1a46644bdab4e94;hpb=8e24e39aed25a2c31fb7073308ee3f0b80c206e6;p=helm.git diff --git a/matita/matitaAutoGui.ml b/matita/matitaAutoGui.ml index 0436c206d..9ba6dd898 100644 --- a/matita/matitaAutoGui.ml +++ b/matita/matitaAutoGui.ml @@ -81,7 +81,17 @@ let cell_of_candidate height context ?(active=false) g id c = in tooltip#set_tip ~text (button :> GObj.widget); ignore(button#connect#clicked - (fun _ -> HLog.warn (string_of_int id); Auto.give_hint id)); + (fun _ -> + let menu = GMenu.menu () in + let follow = GMenu.menu_item ~label:"Follow" () in + let prune = GMenu.menu_item ~label:"Prune" () in + ignore (follow#connect#activate + (fun _ -> HLog.warn (string_of_int id); Auto.give_hint id)); + ignore (prune#connect#activate + (fun _ -> HLog.warn (string_of_int id); Auto.give_prune_hint id)); + menu#append follow; + menu#append prune; + menu#popup 0 (GtkMain.Main.get_current_event_time ()))); button ;; let cell_of_goal height win_width context goal = @@ -114,7 +124,7 @@ let cell_of_candidates height grey context goal cads = ;; let elems_to_rows height context win_width (table : GPack.table) (or_list) = - let height = height / (List.length or_list) in + let height = height / ((List.length or_list) + 1) in let _ = List.fold_left (fun position (goal_id, goal, grey, depth, candidates) -> @@ -180,6 +190,12 @@ let auto_dialog elems = Auto.step (); win#toplevel#destroy (); GMain.Main.quit ())); + ignore(win#toplevel#event#connect#delete + (fun _ -> + Auto.pause false; + Auto.step (); + win#toplevel#destroy (); + GMain.Main.quit ();true)); let redraw_callback _ = fill_win win elems;true in let redraw = GMain.Timeout.add ~ms:400 ~callback:redraw_callback in ignore(win#buttonPAUSE#connect#clicked