From bc5e203f7787980f65f81ddbf69a619ab34fa85e Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 9 Mar 2004 12:41:22 +0000 Subject: toxy alpha6 svn path=/trunk/externals/miXed/; revision=1396 --- shared/toxy/scriptlet.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'shared') diff --git a/shared/toxy/scriptlet.c b/shared/toxy/scriptlet.c index 4806065..4f4221f 100644 --- a/shared/toxy/scriptlet.c +++ b/shared/toxy/scriptlet.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2003 krzYszcz and others. +/* Copyright (c) 2003-2004 krzYszcz and others. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ @@ -425,9 +425,13 @@ void scriptlet_qpush(t_scriptlet *sp) strcpy(tail, "]}}\n"); sys_gui(sp->s_buffer); *tail = 0; - /* LATER find out if reply does not fit better inside the query proc */ - sprintf(buf, "after 0 {::toxy::query\n\ - pd [concat %s _rp $::toxy::reply \\;]}\n", sp->s_rptarget->s_name); + /* Could not find anything more flexible, than blocking while waiting + for ::toxy::query to complete. The model case is a Tk dialog + hanging over the arrival of new queries. LATER probably use + a thread-safe replacement of the 'pd' command in order to prevent + competing tcl threads from corrupting the gui-to-pd stream. */ + sprintf(buf, "after 0 {::toxy::query}\nvwait ::toxy::reply\n\ + pd [concat %s _rp $::toxy::reply \\;]\n", sp->s_rptarget->s_name); sys_gui(buf); } } @@ -613,7 +617,7 @@ int scriptlet_rcload(t_scriptlet *sp, t_pd *caller, char *rc, char *ext, if (sp->s_glist) dir = canvas_getdir(sp->s_glist)->s_name; else - dir = ""; + dir = ""; /* which means pwd, usually the same as at Pd startup... */ if ((fd = open_via_path(dir, rc, ext, buf, &nameptr, MAXPDSTRING, 0)) < 0) { result = SCRIPTLET_NOFILE; -- cgit v1.2.1