]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matitaGtkMisc.ml
some fixes for whelp macros (concerning pprint...)
[helm.git] / matita / matitaGtkMisc.ml
index 553406635aac812e87ba39576f566bbe747f1e08..a41dbffe373713d3ca3fa5858e215f801afe5a58 100644 (file)
 exception PopupClosed
 open Printf
 
-let wrap_callback f = f
+let wrap_callback0 f = fun _ -> try f () with Not_found -> assert false
+let wrap_callback1 f = fun _ -> try f () with Not_found -> assert false
+let wrap_callback2 f = fun _ -> try f () with Not_found -> assert false
 
 let connect_button (button: #GButton.button) callback =
-  ignore (button#connect#clicked (wrap_callback callback))
+  ignore (button#connect#clicked (wrap_callback0 callback))
 
 let connect_toggle_button (button: #GButton.toggle_button) callback =
-  ignore (button#connect#toggled (wrap_callback callback))
+  ignore (button#connect#toggled (wrap_callback1 callback))
 
 let connect_menu_item (menu_item: #GMenu.menu_item) callback =
-  ignore (menu_item#connect#activate (wrap_callback callback))
+  ignore (menu_item#connect#activate (wrap_callback2 callback))
 
 let connect_key (ev:GObj.event_ops) ?(modifiers = []) ?(stop = false) key
   callback