From 64fdb009695828b788fce074135b20a5e52c5fc4 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Tue, 23 Sep 2003 00:21:28 +0000 Subject: imported version 0.37-0 svn path=/trunk/; revision=1016 --- pd/src/g_text.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'pd/src/g_text.c') diff --git a/pd/src/g_text.c b/pd/src/g_text.c index 13619493..7fc2bbdf 100644 --- a/pd/src/g_text.c +++ b/pd/src/g_text.c @@ -457,14 +457,19 @@ static t_symbol *gatom_realizedollar(t_gatom *x, t_symbol *s) static void gatom_set(t_gatom *x, t_symbol *s, int argc, t_atom *argv) { + t_atom oldatom = x->a_atom; + int update = 0; if (!argc) return; if (x->a_atom.a_type == A_FLOAT) - x->a_atom.a_w.w_float = atom_getfloat(argv); + x->a_atom.a_w.w_float = atom_getfloat(argv), + update = (x->a_atom.a_w.w_float != oldatom.a_w.w_float); else if (x->a_atom.a_type == A_SYMBOL) - x->a_atom.a_w.w_symbol = atom_getsymbol(argv); + x->a_atom.a_w.w_symbol = atom_getsymbol(argv), + update = (x->a_atom.a_w.w_symbol != oldatom.a_w.w_symbol); binbuf_clear(x->a_text.te_binbuf); binbuf_add(x->a_text.te_binbuf, 1, &x->a_atom); - glist_retext(x->a_glist, &x->a_text); + if (update) + glist_retext(x->a_glist, &x->a_text); x->a_buf[0] = 0; } @@ -1010,7 +1015,7 @@ static int text_click(t_gobj *z, struct _glist *glist, else return (0); } -static void text_save(t_gobj *z, t_binbuf *b) +void text_save(t_gobj *z, t_binbuf *b) { t_text *x = (t_text *)z; if (x->te_type == T_OBJECT) @@ -1076,8 +1081,6 @@ t_widgetbehavior text_widgetbehavior = text_delete, text_vis, text_click, - text_save, - 0, }; static t_widgetbehavior gatom_widgetbehavior = @@ -1089,8 +1092,6 @@ static t_widgetbehavior gatom_widgetbehavior = text_delete, gatom_vis, text_click, - text_save, - gatom_properties, }; /* -------------------- the "text" class ------------ */ @@ -1305,6 +1306,7 @@ void g_text_setup(void) class_addmethod(gatom_class, (t_method)gatom_param, gensym("param"), A_GIMME, 0); class_setwidget(gatom_class, &gatom_widgetbehavior); + class_setpropertiesfn(gatom_class, gatom_properties); } -- cgit v1.2.1