let set_handler_trees ?(stop=([`CONTROL],GdkKeysyms._g))f_trees ?f_display_state w =
let (stop_mods, stop_key) = stop in
let add () =
let id = w#event#connect#key_press
~callback: (on_key_press ?f_display_state stop_mods stop_key f_trees w)
in
Hashtbl.add states_table (Oo.id w) (id, [])
in
try
let (id, _) = Hashtbl.find states_table (Oo.id w) in
w#misc#disconnect id;
add ()
with
Not_found -> add ()