aboutsummaryrefslogtreecommitdiff
path: root/pd/src/g_text.c
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2006-08-11 20:09:07 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2006-08-11 20:09:07 +0000
commit173b4e7033e4fc902d20a3cc19e9198a61924f37 (patch)
tree7c0f909a98dab4bcda225d7fa478a8c721cbe00c /pd/src/g_text.c
parent9cba3b8fccf2f9d680d5ef7847689fe9cda2e294 (diff)
Fixed to compile correctly on macosx 10.3, 10.4 and Windows.
svn path=/trunk/; revision=5566
Diffstat (limited to 'pd/src/g_text.c')
-rw-r--r--pd/src/g_text.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/pd/src/g_text.c b/pd/src/g_text.c
index 5b3172b1..3cca6b3a 100644
--- a/pd/src/g_text.c
+++ b/pd/src/g_text.c
@@ -30,8 +30,8 @@ t_widgetbehavior text_widgetbehavior;
/* ----------------- the "text" object. ------------------ */
- /* add a "text" object (comment) to a glist. While this one goes for any glist,
- the other 3 below are for canvases only. (why?) This is called
+ /* add a "text" object (comment) to a glist. While this one goes for any
+ glist, the other 3 below are for canvases only. (why?) This is called
without args if invoked from the GUI; otherwise at least x and y
are provided. */
@@ -566,6 +566,19 @@ static void gatom_symbol(t_gatom *x, t_symbol *s)
gatom_bang(x);
}
+ /* We need a list method because, since there's both an "inlet" and a
+ "nofirstin" flag, the standard list behavior gets confused. */
+static void gatom_list(t_gatom *x, t_symbol *s, int argc, t_atom *argv)
+{
+ if (!argc)
+ gatom_bang(x);
+ else if (argv->a_type == A_FLOAT)
+ gatom_float(x, argv->a_w.w_float);
+ else if (argv->a_type == A_SYMBOL)
+ gatom_symbol(x, argv->a_w.w_symbol);
+ else pd_error(x, "gatom_list: need float or symbol");
+}
+
static void gatom_motion(void *z, t_floatarg dx, t_floatarg dy)
{
t_gatom *x = (t_gatom *)z;
@@ -1349,6 +1362,7 @@ void g_text_setup(void)
class_addbang(gatom_class, gatom_bang);
class_addfloat(gatom_class, gatom_float);
class_addsymbol(gatom_class, gatom_symbol);
+ class_addlist(gatom_class, gatom_list);
class_addmethod(gatom_class, (t_method)gatom_set, gensym("set"),
A_GIMME, 0);
class_addmethod(gatom_class, (t_method)gatom_click, gensym("click"),