fixed execution order bug that was causing the first two frame numbers to output...
[puredata.git] / packages / patches / show_whole_subpatch_name_in_window_title-0.41.4.patch
blob1b5f1d6f152b36f1172886d567e8ae7ff8202b37
1 Index: g_canvas.c
2 ===================================================================
3 --- g_canvas.c (revision 9910)
4 +++ g_canvas.c (working copy)
5 @@ -1133,10 +1133,22 @@
7 /* -------------------------- subcanvases ---------------------- */
9 -static void *subcanvas_new(t_symbol *s)
10 +static void *subcanvas_new(t_symbol *s, int argc, t_atom *argv)
12 t_atom a[6];
13 t_canvas *x, *z = canvas_getcurrent();
14 + if (argc)
15 + {
16 + int bufsize;
17 + char *buf;
18 + t_binbuf *bb = binbuf_new();
19 + binbuf_addv(bb, "s", s);
20 + binbuf_add(bb, argc, argv);
21 + binbuf_gettext(bb, &buf, &bufsize);
22 + buf[bufsize] = '\0';
23 + binbuf_free(bb);
24 + s = gensym(buf);
25 + }
26 if (!*s->s_name) s = gensym("/SUBPATCH/");
27 SETFLOAT(a, 0);
28 SETFLOAT(a+1, GLIST_DEFCANVASYLOC);
29 @@ -1750,8 +1762,8 @@
30 A_NULL);
32 /* ----- subcanvases, which you get by typing "pd" in a box ---- */
33 - class_addcreator((t_newmethod)subcanvas_new, gensym("pd"), A_DEFSYMBOL, 0);
34 - class_addcreator((t_newmethod)subcanvas_new, gensym("page"), A_DEFSYMBOL, 0);
35 + class_addcreator((t_newmethod)subcanvas_new, gensym("pd"), A_GIMME, 0);
36 + class_addcreator((t_newmethod)subcanvas_new, gensym("page"), A_GIMME, 0);
38 class_addmethod(canvas_class, (t_method)canvas_click,
39 gensym("click"), A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, A_FLOAT, 0);