<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yiv3321818782"><div id="yui_3_16_0_1_1452539262181_6120"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_1_1452539262181_6119"><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914"><span id="yiv3321818782yui_3_16_0_1_1452528994203_8401">Hi Kaj,</span></div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">In the GUI port of Pd-l2ork I have about 18 sys_vgui calls left to </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">revise.  At that point the tcl strings will be completely removed from the </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">core of Pd-l2ork.</div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914"><br clear="none"></div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">In practice, it's not really a process of changing tcl calls to pd message </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">calls.  Tcl strings are more expressive than pd messages-- they allow </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">you to specify arbitrary strings (e.g., the string may have spaces inside </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">it) and (nested) lists of values.  Since the current code relies on those two features to communicate with the GUI, porting everything to a less expressive </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">message format is a really bad idea.  You'll either end up jumping through </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">hoops to deal with all the edge cases, or coming up with your own syntax </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">for strings containing arbitrary characters and list/array boundaries (at which </div><div dir="ltr" id="yiv3321818782yui_3_16_0_1_1452528994203_3914">they are no longer Pd messages).</div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914"><br clear="none"></div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914">I used pd_vmess as a model and just parameterized the messages to the </div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914">GUI.  That means I have only a handful of functions in one place where I can </div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914" dir="ltr">choose exactly how the commands look when they get sent over the wire.  </div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914" dir="ltr">That way even if I chose the worst possible design, fixing it is just a matter </div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914" dir="ltr">of changing the guts of those few functions instead of having to refactor </div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914" dir="ltr">every single call to the gui throughout all of the core.</div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914" dir="ltr"><br></div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914" dir="ltr">-Jonathan</div><div id="yiv3321818782yui_3_16_0_1_1452528994203_3914"><br clear="none"></div> <div class="yiv3321818782qtdSeparateBR" id="yui_3_16_0_1_1452539262181_6130"><br clear="none"><br clear="none"></div><div class="yiv3321818782yqt5948205811" id="yiv3321818782yqt48497"></div></div></div></div><div class=".yiv3321818782yahoo_quoted"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"><font size="2" face="Arial"> On Monday, January 11, 2016 6:08 AM, Kaj Ailomaa <zequence@mousike.me> wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv3321818782y_msg_container">On Sun, Jan 10, 2016, at 11:59 AM, Kaj Ailomaa wrote:<br clear="none">> <br clear="none">> <br clear="none">> On Tue, Nov 10, 2015, at 07:53 PM, Jonathan Wilkes via Pd-dev wrote:<br clear="none">> > > * convert this to a pd message one at a time<br clear="none">> > If anyone wants some advice on how to do this in practice, PM me.<br clear="none">> > -Jonathan<br clear="none">> > <br clear="none">> >      On Tuesday, November 10, 2015 10:01 AM, Hans-Christoph Steiner<br clear="none">> >      <<a rel="nofollow" shape="rect" ymailto="mailto:hans@at.or.at" target="_blank" href="mailto:hans@at.or.at">hans@at.or.at</a>> wrote:<br clear="none">> > Its been too long for me to give much detail, I definitely wrote about<br clear="none">> > this<br clear="none">> > multiple times, so check the archives.  This is not a great setup, but it<br clear="none">> > is<br clear="none">> > necessary because pd sends drawing commands with pixel values to pd-gui. <br clear="none">> > But<br clear="none">> > I remember it was something like this:<br clear="none">> > <br clear="none">> > * set [tk scaling 1] on all platforms<br clear="none">> > * measure the boxes a lot, on various platforms and versions<br clear="none">> > * fix when the pixel values are different<br clear="none">> > <br clear="none">> > The real way to fix this is to make pd know as little as possible about<br clear="none">> > the<br clear="none">> > GUI stuff, then things can be handled much better in pd-gui.  If you are<br clear="none">> > going<br clear="none">> > to put work into this, the best approach is also a more incremental<br clear="none">> > approach.<br clear="none">> >  This approach will also easily give Pd a scalable GUI.<br clear="none">> > <br clear="none">> > * look for any sys_vgui() call in pd that sends raw Tcl<br clear="none">> > * convert this to a pd message one at a time<br clear="none">> > * push the logic to pd-gui as much as possible<br clear="none">> > <br clear="none">> <br clear="none">> Hi Jonathan, and everyone else!<br clear="none">> <br clear="none">> I would be interested in working on the gui stuff. <br clear="none">> I was just trying to do some theming and tried applying the color scheme<br clear="none">> part of pd-extended as a patch to vanilla. It kind of worked, but it was<br clear="none">> just a first attempt. Anyway, I would very much like to do more of this,<br clear="none">> so please give me some hints.<br clear="none">> <br clear="none">> Scaling would be awesome.<br clear="none">> <br clear="none">> /Kaj Ailomaa<br clear="none">> <br clear="none"><br clear="none">I was looking for an example (using grep) where sys_vgui() sends pd<br clear="none">messages instead of tcl commands to find an example, and this was pretty<br clear="none">much it:<br clear="none"><br clear="none">./s_print.c:        sys_vgui("::pdwindow::post {%s}\n",<br clear="none">strnescape(upbuf, s, MAXPDSTRING));<br clear="none">./s_print.c:        sys_vgui("::pdwindow::logpost {%s} 1 {%s}\n",<br clear="none">./s_print.c:        sys_vgui("::pdwindow::logpost {%s} %d {%s}\n",<br clear="none"><br clear="none">So, that looks easy enough. But, I still have very loose grasp on<br clear="none">everything to do with pd programming. So, there's really a lot for me to<br clear="none">understand. I will need to have a look at pd messages, which ones I<br clear="none">should use, and if I need to create new ones.<br clear="none">Also, how do I actually create an object in the correct patch window<br clear="none">using tcl.<br clear="none">An example of this would be nice, and would allow for me to do some work<br clear="none">right away - at least for testing and getting better acquainted with the<br clear="none">code.<div class="yiv3321818782yqt2547048443" id="yiv3321818782yqtfd79825"><br clear="none"><br clear="none">/Kaj</div><br clear="none"><br clear="none">_______________________________________________<br clear="none">Pd-dev mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:Pd-dev@lists.iem.at" target="_blank" href="mailto:Pd-dev@lists.iem.at">Pd-dev@lists.iem.at</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://lists.puredata.info/listinfo/pd-dev">http://lists.puredata.info/listinfo/pd-dev</a><div class="yiv3321818782yqt2547048443" id="yiv3321818782yqtfd46870"><br clear="none"></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div></body></html>