Commit 60f25bbc authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

added auto-loadbanging of newly created abstractions from the menu

parent c1910c06
...@@ -290,7 +290,8 @@ extern void glist_setlastxy(t_glist *gl, int xval, int yval); ...@@ -290,7 +290,8 @@ extern void glist_setlastxy(t_glist *gl, int xval, int yval);
void canvas_obj_abstraction_from_menu(t_glist *gl, t_symbol *s, int argc, t_atom *argv) void canvas_obj_abstraction_from_menu(t_glist *gl, t_symbol *s, int argc, t_atom *argv)
{ {
//fprintf(stderr,"canvas_abstraction_from_menu\n"); //fprintf(stderr,"canvas_abstraction_from_menu\n");
t_text *x; //t_text *x;
t_gobj *y;
t_binbuf *b = binbuf_new(); t_binbuf *b = binbuf_new();
binbuf_restore(b, 2, argv); binbuf_restore(b, 2, argv);
...@@ -303,6 +304,13 @@ void canvas_obj_abstraction_from_menu(t_glist *gl, t_symbol *s, int argc, t_atom ...@@ -303,6 +304,13 @@ void canvas_obj_abstraction_from_menu(t_glist *gl, t_symbol *s, int argc, t_atom
#endif #endif
canvas_objtext(gl, xpix+atom_getintarg(1, argc, argv), ypix+atom_getintarg(2, argc, argv), 1, b); canvas_objtext(gl, xpix+atom_getintarg(1, argc, argv), ypix+atom_getintarg(2, argc, argv), 1, b);
// the object is now the last on the glist so we locate it and send it loadbang
// we know we have at least one object since we just created one so we don't check for y being valid
y = gl->gl_list;
while (y->g_next)
y = y->g_next;
canvas_loadbang((t_canvas *)y);
if (connectme) { if (connectme) {
canvas_connect(gl, indx, 0, nobj, 0); canvas_connect(gl, indx, 0, nobj, 0);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment