diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2010-04-01 14:41:08 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2010-04-01 14:41:08 +0000 |
commit | f31b6e501c3b0e28c41bd573c1338ea4b036cbb7 (patch) | |
tree | 38645cf16f2149f45055d9e54d771cf43afaa2ea /src | |
parent | cb030b6f9c7650045e3518b4307f7680b20b626c (diff) |
safe the old propertiesfn of the canvas-class and use that if we are called
erroneously
svn path=/trunk/externals/iem/iemguts/; revision=13361
Diffstat (limited to 'src')
-rw-r--r-- | src/propertybang.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/propertybang.c b/src/propertybang.c index d100ad3..a2faf40 100644 --- a/src/propertybang.c +++ b/src/propertybang.c @@ -42,6 +42,8 @@ typedef struct _propertybang } t_propertybang; +t_propertiesfn s_orgfun=NULL; + static void propertybang_free(t_propertybang *x) { removeObjectFromCanvases((t_pd*)x); @@ -53,7 +55,10 @@ static void propertybang_bang(t_propertybang *x) { static void propertybang_properties(t_gobj*z, t_glist*owner) { t_iemguts_objlist*objs=objectsInCanvas((t_pd*)z); - while(objs) { + if(NULL==objs) { + s_orgfun(z, owner); + } + while(objs) { t_propertybang*x=(t_propertybang*)objs->obj; propertybang_bang(x); objs=objs->next; @@ -66,9 +71,14 @@ static void *propertybang_new(void) t_glist *glist=(t_glist *)canvas_getcurrent(); t_canvas *canvas=(t_canvas*)glist_getcanvas(glist); t_class *class = ((t_gobj*)canvas)->g_pd; - + t_propertiesfn orgfun=NULL; + outlet_new(&x->x_obj, &s_bang); + orgfun=class_getpropertiesfn(class); + if(orgfun!=propertybang_properties) + s_orgfun=orgfun; + class_setpropertiesfn(class, propertybang_properties); addObjectToCanvas((t_pd*)canvas, (t_pd*)x); @@ -80,4 +90,6 @@ void propertybang_setup(void) propertybang_class = class_new(gensym("propertybang"), (t_newmethod)propertybang_new, (t_method)propertybang_free, sizeof(t_propertybang), CLASS_NOINLET, 0); class_addbang(propertybang_class, propertybang_bang); + + s_orgfun=NULL; } |