From 59b6ed633cd63ec112f4367365ac14479a8e4120 Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Wed, 13 Nov 2002 08:53:08 +0000 Subject: 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 --- doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd (limited to 'doc/additional/pd-msg/4.msg_from_tcl/1.tcl2pd') 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 -- cgit v1.2.1