summaryrefslogtreecommitdiff
path: root/examples/unBind.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/unBind.tcl')
-rwxr-xr-xexamples/unBind.tcl22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/unBind.tcl b/examples/unBind.tcl
new file mode 100755
index 0000000..6440f1a
--- /dev/null
+++ b/examples/unBind.tcl
@@ -0,0 +1,22 @@
+#!/usr/bin/tclsh
+load ./libtclivy.so.3.6
+
+proc connect { client action } { }
+
+proc send { } {
+ global tosend
+ Ivy::send $tosend
+}
+
+proc dotext {client} {
+ global id
+ puts "$client told me to unbind (to $id)"
+ Ivy::unbind $id
+}
+
+Ivy::init "TCLTK" "TCLTK Ready" connect connect
+Ivy::start ""
+set id [Ivy::bind "^unbind" dotext]
+puts "bound to value $id"
+
+vwait tcl_interactive