summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/builtin/selection_handle_set.ml
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/labltk/builtin/selection_handle_set.ml')
-rw-r--r--otherlibs/labltk/builtin/selection_handle_set.ml15
1 files changed, 15 insertions, 0 deletions
diff --git a/otherlibs/labltk/builtin/selection_handle_set.ml b/otherlibs/labltk/builtin/selection_handle_set.ml
new file mode 100644
index 000000000..2cdd0abe7
--- /dev/null
+++ b/otherlibs/labltk/builtin/selection_handle_set.ml
@@ -0,0 +1,15 @@
+(* The function *must* use tkreturn *)
+let handle_set command: cmd =
+selection_handle_icccm_optionals (fun opts w ->
+tkEval [|TkToken"selection";
+ TkToken"handle";
+ TkTokenList
+ (List.map opts fun:(cCAMLtoTKselection_handle_icccm w));
+ cCAMLtoTKwidget w;
+ let id = register_callback w callback:(function args ->
+ let a1 = int_of_string (List.hd args) in
+ let a2 = int_of_string (List.nth args pos:1) in
+ tkreturn (cmd pos:a1 len:a2)) in TkToken ("camlcb "^id)
+ |];
+ ())
+