aboutsummaryrefslogtreecommitdiff
path: root/doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd
diff options
context:
space:
mode:
authorGuenter Geiger <ggeiger@users.sourceforge.net>2002-11-13 08:53:08 +0000
committerGuenter Geiger <ggeiger@users.sourceforge.net>2002-11-13 08:53:08 +0000
commit59b6ed633cd63ec112f4367365ac14479a8e4120 (patch)
tree93246a8e380042152689005b2e50a542b03c5bd9 /doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd
parent02a5595973b61d2cf789b9074167ed73b928d157 (diff)
This commit was generated by cvs2svn to compensate for changes in r208,
which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=209
Diffstat (limited to 'doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd')
-rwxr-xr-xdoc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd b/doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd
new file mode 100755
index 00000000..883cc78e
--- /dev/null
+++ b/doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd
@@ -0,0 +1,33 @@
+#!/usr/bin/wish -f
+
+#Here a small exemple that show how to send msg to pd from TCL.
+#damien HENRY
+#dh20010806
+
+puts "*********************"
+puts "* pd -nogui example *"
+puts "* (c) Damien HENRY *"
+puts "* This is GPL... *"
+puts "*********************"
+puts ""
+puts "WARNING : you need to run pd -open and load recv.pd first"
+
+#definition of the procedure that send msg to pd
+proc pd_send {string2send} {
+ set to_pd [socket localhost 3006]
+ puts $to_pd $string2send
+ .lmsg configure -text $string2send
+ close $to_pd
+}
+
+#create the gui
+wm title . "a simple tcl/tk gui msg-sender to pd"
+button .bsend -text "send to pd" -width 20 -command {pd_send "$pd_rcv $text2send;"}
+button .bq -text "quit" -width 20 -command {exit}
+entry .msg -textvariable text2send -width 30
+entry .pd_rcv -textvariable pd_rcv -width 10
+label .l1 -text "destination"
+label .l2 -text "msg to send"
+label .lmsg
+
+pack .l1 .pd_rcv .l2 .msg .lmsg .bsend .bq \ No newline at end of file