<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="yiv4483104770"><div id="yui_3_16_0_ym19_1_1462302885233_8417"><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_ym19_1_1462302885233_8416"><div id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3538">One thing to add-- I believe Hans' proposal was to actually load </div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3580">the *-meta.pd so that it's just sitting there in the background like </div><div dir="ltr" id="yui_3_16_0_ym19_1_1462302885233_8491">the garray template canvases.</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3637"><br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3725">So I guess the idea is:</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3672">1) see if LIB-meta.pd exists when trying to load LIB.</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3673">2) if it exists, load it as an invisible background canvas.</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3913">3) done</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3914"><br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3915">So for your case I guess you would need a public interface to try to </div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3917">load a library at runtime from the GUI.  And sitting in your LIB-meta.pd </div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1462302885233_3917">patch is the external object that you want to exist.</div><div class="yiv4483104770qtdSeparateBR" id="yui_3_16_0_ym19_1_1462302885233_8454"><br></div><div class="yiv4483104770qtdSeparateBR" id="yui_3_16_0_ym19_1_1462302885233_8454">-Jonathan<br clear="none"><br clear="none"></div></div></div></div><div class=".yiv4483104770yahoo_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 class="qtdSeparateBR"><br><br></div><div class="yiv4483104770yqt8459417050" id="yiv4483104770yqt14743"><div dir="ltr"><font size="2" face="Arial"> On Thursday, April 21, 2016 11:10 AM, Jonathan Wilkes via Pd-dev <pd-dev@lists.iem.at> wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv4483104770y_msg_container"><div id="yiv4483104770"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_11938">For a1) I've also thought about abusing the invisible template-canvas, for a different purpose.  But that's a <br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12048">short term gain for the risk of bigger problems and unnecessary side-effects later.</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12269"><br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12270">If you still want to go the route of invisible canvas, there should probably be a simple interface to create and <br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12271">manage a new invisible canvas for that purpose.  That way if you need to debug your invisible canvas, you <br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12272">don't end up nuking garray's drawing instruction when you accidentally close it (for a simple example).</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12300"><br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12301">I know Hans was thinking in that direction for libdir loading.  I'm still not sure if that's a good idea, though.</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12491"><br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12492">But backing up a bit...</div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12493"><br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12556">If you're goal is to get rid of tcl in the C code in an external written for Pd Vanilla, why not use this:<br clear="none"></div><div dir="ltr" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12577"><a rel="nofollow" shape="rect" class="yiv4483104770" id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12576" target="_blank" href="https://github.com/CICM/CicmWrapper">https://github.com/CICM/CicmWrapper</a><br clear="none"></div><div id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12621"><br clear="none"></div><div id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_12705"><br clear="none"></div><div id="yiv4483104770yui_3_16_0_ym19_1_1461247656715_11608"><span></span></div> <div class="yiv4483104770qtdSeparateBR"><br clear="none"><br clear="none"></div><div class="yiv4483104770yahoo_quoted" style="display:block;"> <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 class="yiv4483104770yqt2563009503" id="yiv4483104770yqtfd66903"><div dir="ltr"><font face="Arial" size="2"> On Thursday, April 21, 2016 10:08 AM, IOhannes m zmölnig <zmoelnig@iem.at> wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv4483104770y_msg_container">i'm developing a little something that consists of a gui-plugin and some<br clear="none">library running on the pd-core side.<br clear="none"><br clear="none">the gui plugin does not make any sense without the library loaded and<br clear="none">vice-versa.<br clear="none"><br clear="none">so i'm looking for the best way to<br clear="none">a1) load an external from a gui-plugin<br clear="none">OR<br clear="none">a2) load a gui-plugin from an external<br clear="none">AND/OR<br clear="none">b) check from one side that the other side is initialized properly.<br clear="none"><br clear="none">all of the above should not make any assumptions about the OS.<br clear="none">all of the above should work without any nasty trace-back errors.<br clear="none">instead, i would like to do the error-reporting myself (a traceback is<br clear="none">cool for a dev; less so for a user)<br clear="none"><br clear="none">ad a1) i was thinking about abusing one of the invisible<br clear="none">template-canvases to instantiate a dummy object that triggers the<br clear="none">library load (e.g. "_float_template"). are there any pitfalls that i<br clear="none">should be aware of?<br clear="none"><br clear="none">ad a2) the main reason or writing a GUI-plugin is to get rid of any<br clear="none">tcl/tk hard-coded into the C-plugin. i guess sending a command like<br clear="none">"load_plugin_script mycoolthing" is platform agnostic enough for my<br clear="none">needs. however, it seems that the only way to load a plugin is currently<br clear="none">by specifying the full filename: "load_plugin_script mycoolthing.tcl"; hmpf<br clear="none">it also throws a nasty error if Pd cannot find the GUI-plugin:<br clear="none">> Tcl) UNHANDLED ERROR: couldn't open "mycoolthing.tcl": no such file or<br clear="none">directory<br clear="none"><br clear="none">ad b) the basic idea is to have a ping-function on the *other* side,<br clear="none">that replies with a "hi, i'm here" when called.<br clear="none">so far i've found two options:<br clear="none">b1) create a proc in the plugin, and call that directly from the core;<br clear="none">or b2) have the GUI register a plugin-receiver that does the dispatching.<br clear="none">unfortunately both solutions give me a backtrace when the GUI-plugin has<br clear="none">not been instantiated (and the point of the exercise is to avoid a<br clear="none">backtrace)<br clear="none"><br clear="none">ideas?<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="https://lists.puredata.info/listinfo/pd-dev">https://lists.puredata.info/listinfo/pd-dev</a><br clear="none"><br clear="none"><br clear="none"></div>  </div></div><div class="yiv4483104770yqt2563009503" id="yiv4483104770yqtfd53346"> </div></div><div class="yiv4483104770yqt2563009503" id="yiv4483104770yqtfd16193">  </div></div></div></div></div><br clear="none"><div class="yiv4483104770yqt2563009503" id="yiv4483104770yqtfd57536">_______________________________________________<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="https://lists.puredata.info/listinfo/pd-dev">https://lists.puredata.info/listinfo/pd-dev</a><br clear="none"></div><br clear="none"><br clear="none"></div></div>  </div> </div>  </div></div></body></html>