B. Bogart wrote:
I'm not sure if this should stay on gem-dev or what...
Anyhow I've traced the issue and here is where the problem lies. My original code outputted the symbol like so:
sys_vgui("pd [concat entry%p output [.x%x.c.s%x get 0.0 end] \;]\n", x, x->x_glist, x);
Johannes made the valiant effort to escape "," and ";" so that are not seperated into descrete messages in PD. Basically meaning you can't type a message for the entry widget containing messages for it, and you can't send to a receive directly from the widget. I think this is ok, but I did not see much reason to change it. His change looks like this:
sys_vgui("pd [concat entry%p output [string map {"," "\\," ";" "\\;} [.x%x.c.s%x get 0.0 end]]" \;]\n", x, x->x_glist, x);
very weird. now that i looked at it, i can confirm that it doesn't work here either! my first thought was that i probably used a patched pd-version, but looking a bit closer it revealed that the quoting was really just wrong. it should read:
sys_vgui("pd [concat entry%p output [string map {"," "\\," ";" "\\;"} [.x%x.c.s%x get 0.0 end]] \;]\n", x, x->x_glist, x);
(so the escaped quote at after "end]]" should really be before "}")
i have no idea how this happened.
attached is a unified diff for my changes (or should i simply commit them?)
mfg.asd.r IOhannes
ps: i moved this to pd-dev (even though it might be a bit late)
Index: entry.c =================================================================== RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry.c,v retrieving revision 1.5 diff -u -r1.5 entry.c --- entry.c 11 Dec 2005 17:06:58 -0000 1.5 +++ entry.c 12 Dec 2005 14:55:42 -0000 @@ -320,11 +320,15 @@ /* Pass the contents of the text widget onto the entry_output fuction above */ static void entry_bang_output(t_entry* x) { -/* This code is not functional, all OS's return "unmatches quote in string" removed until someone has time to look more closely. - sys_vgui("pd [concat entry%p output [string map {"," "\\," ";" "\\;} [.x%x.c.s%x get 0.0 end]]" \;]\n", x, x->x_glist, x); */ +#if 1 + /* + JMZ: i desperately need "," and ";" to not be treated special by pd + */ + sys_vgui("pd [concat entry%p output [string map {"," "\\," ";" "\\;"} [.x%x.c.s%x get 0.0 end]] \;]\n", x, x->x_glist, x);
+#else sys_vgui("pd [concat entry%p output [.x%x.c.s%x get 0.0 end] \;]\n", x, x->x_glist, x); - +#endif sys_vgui("bind .x%x.c.s%x <Leave> {focus [winfo parent .x%x.c.s%x]} \n", x->x_glist, x, x->x_glist, x); }
Hi Johannes,
thanks for the patch, I applied and added more comments, as well as leaving the old code in, commented out, in case someone decides they want to turn escaping on and off at runtime.
Thanks for the fix, working great now.
[entry] in CVS is not working with "," and ";" escaping.
PS: I'd like to hear more about what exactly your using entry for.
b.
IOhannes m zmoelnig wrote:
B. Bogart wrote:
I'm not sure if this should stay on gem-dev or what...
Anyhow I've traced the issue and here is where the problem lies. My original code outputted the symbol like so:
sys_vgui("pd [concat entry%p output [.x%x.c.s%x get 0.0 end] \;]\n", x, x->x_glist, x);
Johannes made the valiant effort to escape "," and ";" so that are not seperated into descrete messages in PD. Basically meaning you can't type a message for the entry widget containing messages for it, and you can't send to a receive directly from the widget. I think this is ok, but I did not see much reason to change it. His change looks like this:
sys_vgui("pd [concat entry%p output [string map {"," "\\," ";" "\\;} [.x%x.c.s%x get 0.0 end]]" \;]\n", x, x->x_glist, x);
very weird. now that i looked at it, i can confirm that it doesn't work here either! my first thought was that i probably used a patched pd-version, but looking a bit closer it revealed that the quoting was really just wrong. it should read:
sys_vgui("pd [concat entry%p output [string map {"," "\\," ";" "\\;"} [.x%x.c.s%x get 0.0 end]] \;]\n", x, x->x_glist, x);
(so the escaped quote at after "end]]" should really be before "}")
i have no idea how this happened.
attached is a unified diff for my changes (or should i simply commit them?)
mfg.asd.r IOhannes
ps: i moved this to pd-dev (even though it might be a bit late)
Index: entry.c
RCS file: /cvsroot/pure-data/externals/bbogart/entry/entry.c,v retrieving revision 1.5 diff -u -r1.5 entry.c --- entry.c 11 Dec 2005 17:06:58 -0000 1.5 +++ entry.c 12 Dec 2005 14:55:42 -0000 @@ -320,11 +320,15 @@ /* Pass the contents of the text widget onto the entry_output fuction above */ static void entry_bang_output(t_entry* x) { -/* This code is not functional, all OS's return "unmatches quote in string" removed until someone has time to look more closely.
- sys_vgui("pd [concat entry%p output [string map {"," "\\," ";" "\\;} [.x%x.c.s%x get 0.0 end]]" \;]\n", x, x->x_glist, x); */
+#if 1
- /*
JMZ: i desperately need "," and ";" to not be treated special by pd
- */
- sys_vgui("pd [concat entry%p output [string map {"," "\\," ";" "\\;"} [.x%x.c.s%x get 0.0 end]] \;]\n", x, x->x_glist, x);
+#else sys_vgui("pd [concat entry%p output [.x%x.c.s%x get 0.0 end] \;]\n", x, x->x_glist, x);
+#endif sys_vgui("bind .x%x.c.s%x <Leave> {focus [winfo parent .x%x.c.s%x]} \n", x->x_glist, x, x->x_glist, x); }
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev