let new_click =
let new_marshaller f x y =
MathView.Signals.click.S.marshaller
- (fun e s -> f (new Gdome.element e) s) x y
+ (fun e s -> f (option_element_of_option e) s) x y
in
{ S.name = "click"; S.classe = `math_view;
S.marshaller = new_marshaller }
object ('a)
inherit GContainer.container_signals
val obj: 'b Gtk.obj
- method click : callback:(Gdome.element -> int -> unit) -> GtkSignal.id
+ method click :
+ callback:(Gdome.element option -> int -> unit) -> GtkSignal.id
method element_over :
callback:(Gdome.element option -> int -> unit) -> GtkSignal.id
method select_begin :
let marshal_click f _ =
function
[GtkArgv.POINTER element; GtkArgv.INT state] ->
- f (gdome_element_of_boxed_option element) state
+ f (gdome_element_option_of_boxed_option element) state
| _ -> invalid_arg "GtkMathView.MathView.Signals.marshal_click"
in
{ name = "click"; classe = `math_view; marshaller = marshal_click }
end
| None -> assert false (* every element has a parent *)
-let click mathview (element : Gdome.element) _ =
+let click mathview (element : Gdome.element option) _ =
let module G = Gdome in
- if not (jump element) then
- if not (mathview#action_toggle element) then
- ()
+ match element with
+ None -> print_string "CLICKED ON NOTHING\n" ; flush stdout
+ | Some element ->
+ if not (jump element) then
+ if not (mathview#action_toggle element) then
+ ()
;;