From 60f25bbc831de5874256a4d34ee1b204ed203b34 Mon Sep 17 00:00:00 2001 From: Ivica Ico Bukvic <ico@vt.edu> Date: Sat, 28 Jul 2012 13:38:37 -0400 Subject: [PATCH] added auto-loadbanging of newly created abstractions from the menu --- src/g_text.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/g_text.c b/src/g_text.c index d275020dc..0854ed857 100644 --- a/src/g_text.c +++ b/src/g_text.c @@ -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) { //fprintf(stderr,"canvas_abstraction_from_menu\n"); - t_text *x; + //t_text *x; + t_gobj *y; t_binbuf *b = binbuf_new(); 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 #endif 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) { canvas_connect(gl, indx, 0, nobj, 0); } -- GitLab