On 2016-12-06 09:17, Roman Haefeli wrote:
I'm considering making a GUI plugin part of distributable Pd project. Now, I wonder if:
- a GUI plugin from the project's path instead of a Pd's standard search path.
although the verb is missing, i am pretty sure that the answer is "yes" (not a problem).
- there is way for the main patch to communicate with the GUI plugin. I'd like to allow some configurations to be done in the patch, so that it will affect the behavior of the GUI plugin.
there's a mechanism that allows for easy sending from core to a plugin.
::pd_connect::register_plugin_dispatch_receiver <myplugin> <callback>
(where "<myplugin>" is a unique ID for your plugin, and <callback> is the name of the callback function in your gui-plugin.
the "pd" receiver. this will call the <callback> function on the Pd-GUI with the "..." args.
see attachments for a trivial example.
iirc, this has been introduced with the GUI rewrite (so it has been here for quite some time). however, older versions (<0.47 ?) of Pd would complain bitterly, if you sent something to an unregistered receiver (e.g. the GUI plugin did not load)
fgmasdr IOhannes