val after: bool
val obj: 'b Gtk.obj
method click :
- callback:(Gdome.element option -> int -> unit) -> GtkSignal.id
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
method element_over :
- callback:(Gdome.element option -> int -> unit) -> GtkSignal.id
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
method select_begin :
- callback:(Gdome.element option -> int -> unit) -> GtkSignal.id
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
method select_over :
- callback:(Gdome.element option -> int -> unit) -> GtkSignal.id
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
method select_end :
- callback:(Gdome.element option -> int -> unit) -> GtkSignal.id
+ callback:(Gdome.element option * int * int * int -> unit) -> GtkSignal.id
method select_abort :
callback:(unit -> unit) -> GtkSignal.id
end
ignore
(self#connect#select_begin
- (fun (elem : Gdome.element option) _ ->
+ (fun ((elem : Gdome.element option), _, _, _) ->
if not (same_element root_selected elem) then selection_changed elem ;
first_selected <- elem)) ;
ignore
(self#connect#select_over
- (fun (elem : Gdome.element option) _ ->
+ (fun ((elem : Gdome.element option), _, _, _) ->
let new_selected =
match first_selected, elem with
Some first', Some last' ->
ignore
(self#connect#select_end
- (fun (elem : Gdome.element option) _ -> first_selected <- None)) ;
+ (fun ((elem : Gdome.element option), _, _, _) -> first_selected <- None)) ;
ignore
(self#connect#select_abort
first_selected <- None ;
selection_changed None)) ;
- ignore (self#connect#click (fun _ _ -> self#set_selection None))
+ ignore (self#connect#click (fun _ -> self#set_selection None))
end
;;
self#thaw
method add_selection (elem : Gdome.element) =
+ List.iter self#unselect selected ;
selected <- elem::(remove_descendants_of elem selected) ;
- self#select elem
+ List.iter self#select selected
method get_selections = selected
initializer
ignore
(self#connect#select_begin
- (fun _ state ->
+ (fun (_,_,_,state) ->
if not (List.mem `CONTROL (Gdk.Convert.modifier state)) then
self#remove_selections)) ;
ignore
(self#connect#select_over
- (fun _ state ->
+ (fun (_,_,_,state) ->
let c =
function
`SHIFT -> "shift "
ignore
(self#connect#select_end
- (fun _ state ->
+ (fun (_,_,_,state) ->
if not (List.mem `CONTROL (Gdk.Convert.modifier state)) then
self#remove_selections ;
match root_selected with
ignore
(self#connect#click
- (fun _ _ -> self#remove_selections))
+ (fun _ -> self#remove_selections))
end
;;
"ml_gtk_math_view_gdome_element_option_of_boxed_option"
;;
-external model_event_of_boxed_option model_event :
- Gpointer.boxed -> TElement.t option * gint * gint * gint =
- "ml_gtk_math_view_model_event_of_boxed"
+external model_event_of_boxed_option :
+ Gpointer.boxed option -> TElement.t option * int * int * int =
+ "ml_gtk_math_view_model_event_of_boxed_option"
let option_element_of_option =
function
let model_event_of_boxed model_event =
let id,x,y,state = model_event_of_boxed_option model_event in
- option_element_of_boxed_option id,x,y,state
+ option_element_of_option id,x,y,state
;;
let gdome_element_option_conv =
flush stdout
;;
-let element_over mathview (element : Gdome.element option) _ =
+let element_over mathview ((element : Gdome.element option), _, _, _) =
print_endline ("element_over: " ^
(match element with
None -> "element_over on nothing"
end
| None -> assert false (* every element has a parent *)
-let click mathview (element : Gdome.element option) _ =
+let click mathview ((element : Gdome.element option), _, _, _) =
let module G = Gdome in
match element with
None -> print_string "CLICKED ON NOTHING\n" ; flush stdout
let selection =
match mathview#get_selection with
Some element -> element#get_tagName#to_string
- | None -> "no selection!"
+ | None -> "no selection! but there are " ^ (string_of_int (List.length mathview#get_selections)) ^ " multiple selections!"
in
print_string ("selection: " ^ selection ^ "\n") ;
flush stdout