summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/builtin/selection_handle_set.ml
blob: d46a90f13cec988e081bc66d777dc8b2eb950ee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(* The function *must* use tkreturn *)
let handle_set ~command =
selection_handle_icccm_optionals (fun opts w ->
  tkCommand [|TkToken"selection";
              TkToken"handle";
              TkTokenList opts;
              cCAMLtoTKwidget w;
              let id = register_callback w ~callback:
                begin fun args ->
                  let pos = int_of_string (List.hd args) in
                  let len = int_of_string (List.nth args 1) in
                  tkreturn (command ~pos ~len)
                end
              in TkToken ("camlcb " ^ id)
            |])