diff --git a/pd/src/pd.tk b/pd/src/pd.tk index 8958efaf69333df166b1d5d57261704b48177ff1..c143719744ab6b4a2051e93ab18301e856904be1 100644 --- a/pd/src/pd.tk +++ b/pd/src/pd.tk @@ -329,6 +329,15 @@ proc center_window { w args } { wm geom $w +$x+$y } +# backported workaround for pdsend +#proc pdsend { args } { +# #puts stderr "===============pdsend pdtk $args" +# pd [concat pd $args \;] +#} +proc ::pdsend {args} { + #puts stderr "===============[join $args { }]" + pd "[join $args { }] ;" +} # start Pd-extended font hacks ----------------------------- diff --git a/pd/src/t_tkcmd.c b/pd/src/t_tkcmd.c index 97c55d49939e12ef24b403dc2a7b8be6f3e9e4dc..42ca639df764c08b2fdb4e9988ddd5bf12863614 100644 --- a/pd/src/t_tkcmd.c +++ b/pd/src/t_tkcmd.c @@ -511,10 +511,10 @@ static int pdCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv) { Tcl_DString dstring; /* used to convert the Tcl string to the OS encoding */ char *dstring_char; - if (argc == 2) + /*if (argc == 2) { int n = strlen(argv[1]); - /* NULL as first arg means use the current system encoding */ + // NULL as first arg means use the current system encoding dstring_char = Tcl_UtfToExternalDString(NULL, argv[1], -1, &dstring); if (send(sockfd, dstring_char, n, 0) < n) { @@ -523,7 +523,7 @@ static int pdCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv) } } else - { + {*/ int i; char buf[MAXWRITE]; buf[0] = 0; @@ -535,7 +535,7 @@ static int pdCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv) Tcl_NewStringObj("pd: arg list too long", -1)); return (TCL_ERROR); } - if (i > 1) strcat(buf, " "); + strcat(buf, " "); strcat(buf, argv[i]); } /* NULL as first arg means use the current system encoding */ @@ -545,7 +545,8 @@ static int pdCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv) perror("stdout"); tcl_mess("exit\n"); } - } + //} + //fprintf(stderr, "dstring_char = <%s>\n", dstring_char); Tcl_DStringFree(&dstring); return (TCL_OK); } @@ -611,8 +612,8 @@ void pdgui_startup(Tcl_Interp *interp) /* add our own TK commands */ Tcl_CreateCommand(interp, "pd", (Tcl_CmdProc*)pdCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL); - Tcl_CreateCommand(interp, "pdsend", (Tcl_CmdProc*)pdCmd, (ClientData)NULL, - (Tcl_CmdDeleteProc *)NULL); + //Tcl_CreateCommand(interp, "pdsend", (Tcl_CmdProc*)pdCmd, (ClientData)NULL, + // (Tcl_CmdDeleteProc *)NULL); #ifdef MSW Tcl_CreateCommand(interp, "pd_pollsocket",(Tcl_CmdProc*) pd_pollsocketCmd, (ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);