From 9cd050f663f3122b5dfbc00d18c59c94366331e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Tue, 5 Feb 2013 14:06:29 +0000 Subject: 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 --- popup/popup.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'popup') 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(); } -- cgit v1.2.1