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