diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2009-06-17 06:27:18 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2009-06-17 06:27:18 +0000 |
commit | 786a331f4433b8fa247f774b811f159439658cc4 (patch) | |
tree | 4cc03d31ee3255acc40548c7f30217d2e02c2fd9 | |
parent | 0fb4c8957e8ade0c2969aede81c2b738b5ce0df3 (diff) |
applied luke's patch that shows that this object _is_ useful
svn path=/trunk/externals/iem/iemguts/; revision=11791
-rw-r--r-- | src/canvasselect.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/canvasselect.c b/src/canvasselect.c index 7d0cf12..4530ccc 100644 --- a/src/canvasselect.c +++ b/src/canvasselect.c @@ -48,11 +48,29 @@ static void canvasselect_bang(t_canvasselect *x) if(NULL==glist) { return; } + t_atom selected_index; + int nselected=0; + + for(obj=glist->gl_list; obj; obj=obj->g_next, index++) { + if(glist_isselected(glist, obj)) { + // post("selected: %d", index); + nselected++; + } + } + int n=0; + index=0; + t_atom *atombuf; + + atombuf = (t_atom *)getbytes(sizeof(t_atom)*nselected); + for(obj=glist->gl_list; obj; obj=obj->g_next, index++) { if(glist_isselected(glist, obj)) { - post("selected: %d", index); + SETFLOAT(&atombuf[n], index); + n++; } } + + outlet_list(x->x_obj.ob_outlet, &s_list, nselected, atombuf); } @@ -184,7 +202,8 @@ static void *canvasselect_new(t_floatarg f) } x->x_canvas = canvas; - + + outlet_new(&x->x_obj, 0); return (x); } |