I have a Tk app that contains little more than a text widget:
Then I have another Tk app that is supposed to display a string (tagged) in the first app's text widget:
When I run the receiving app and the sending app, nothing happens when I press the button. However, if I show the console on the sending app and type in the exact same comand: $target insert end $sndstr\n $counter, after making sure the variables are set, the string is properly displayed in the target text widget.
Can anyone see why the GUI command isn't working?
Bob Rashkin
rrashkin@csc.com
Code:
package require dde
dde servername receiving
pack [frame .f1] -side top
pack [text .f1.t1] -side top
Then I have another Tk app that is supposed to display a string (tagged) in the first app's text widget:
Code:
package require dde
dde servername sending
foreach f {1 2 3} {pack [frame .$f] -side left}
pack [label .1.l1 -text "string to send"] -side top
pack [entry .2.e1 -textvariable sndstr] -side top
pack [button .3.b1 -text send -command {set counter [ddeSend $counter $sndstr]}
set counter 1
set sndstr "data from sender"
proc ddeSend {counter sndstr} {
set target .f1.t1
dde execute TclEval receiving {$target insert end $sndstr\n $counter}
incr counter
return $counter
}
When I run the receiving app and the sending app, nothing happens when I press the button. However, if I show the console on the sending app and type in the exact same comand: $target insert end $sndstr\n $counter, after making sure the variables are set, the string is properly displayed in the target text widget.
Can anyone see why the GUI command isn't working?
Bob Rashkin
rrashkin@csc.com