diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2013-02-05 14:06:29 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2013-02-05 14:06:29 +0000 |
commit | 9cd050f663f3122b5dfbc00d18c59c94366331e7 (patch) | |
tree | 2304cf3b478e19445b24a2efa1c630ac98179ea4 | |
parent | 08fc7edfdd32ac8d58e16ae53466e3ec85755678 (diff) |
compat with Pd>=0.43
after the GUI rewrite, pd-gui uses 'pdsend' to send messages back
to Pd, rather than 'pd' (as with Pd<=0.42)
LATER: check about PdX
svn path=/trunk/externals/bbogart/; revision=17025
-rw-r--r-- | popup/popup.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/popup/popup.c b/popup/popup.c index 1ea98a3..281eb7a 100644 --- a/popup/popup.c +++ b/popup/popup.c @@ -34,6 +34,17 @@ #define MAX_OPTIONS 100 + +static char* popup_send2pd = "pd"; +static void popup_checkversion(void) { +#if (defined PD_MINOR_VERSION) && (PD_MINOR_VERSION >= 43) + int major=0, minor=0, bugfix=0; + sys_getversion(&major, &minor, &bugfix); + if(minor>=43) + popup_send2pd="pdsend"; +#endif +} + typedef struct _popup { t_object x_obj; @@ -626,8 +637,8 @@ static void *popup_new(t_symbol *s, int argc, t_atom *argv) pd_bind(&x->x_obj.ob_pd, x->x_sym); /* define proc in tcl/tk where "popup%p" is the receive, "output" is the method, and "$index" is an argument. */ - sys_vgui("proc popup_sel%lx {index} {\n pd [concat %s output $index \\;]\n }\n", - x, buf); + sys_vgui("proc popup_sel%lx {index} {\n %s [concat %s output $index \\;]\n }\n", + x, popup_send2pd, buf); /* Add symbol inlet (hard to say how this actually works?? */ inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("symbol"), gensym("")); @@ -696,6 +707,7 @@ void popup_setup(void) { #endif post("Popup v0.1 Ben Bogart.\nCVS: $Revision: 1.18 $ $Date: 2007-10-29 18:58:42 $"); + popup_checkversion(); } |