aboutsummaryrefslogtreecommitdiff
path: root/popup/popup.c
diff options
context:
space:
mode:
Diffstat (limited to 'popup/popup.c')
-rw-r--r--popup/popup.c16
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();
}