Now that pdlua and tclpd are officially part of Pd-extended, I just had a little thought/feature request to make working with those objects easier. It would be very nice if you could right-click on the object, and click "Open" and have Pd open the script file in the associated editor. You can do this on all platforms using:
::pd_menucommands::menu_openfile {filename}
Or at least use that as example code for how to do it.
.hc
----------------------------------------------------------------------------
"We have nothing to fear from love and commitment." - New York Senator Diane Savino, trying to convince the NY Senate to pass a gay marriage bill
that feature should also be possible with a command, like [open(.
Now that pdlua and tclpd are officially part of Pd-extended, I just had a little thought/feature request to make working with those objects easier. It would be very nice if you could right-click on the object, and click "Open" and have Pd open the script file in the associated editor. You can do this on all platforms using:
::pd_menucommands::menu_openfile {filename}
Or at least use that as example code for how to do it.
.hc
"We have nothing to fear from love and commitment." - New York Senator Diane Savino, trying to convince the NY Senate to pass a gay marriage bill
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
On 2011-10-12 12:43, Hans-Christoph Steiner wrote:
Now that pdlua and tclpd are officially part of Pd-extended, I just had a little thought/feature request to make working with those objects easier. It would be very nice if you could right-click on the object, and click "Open" and have Pd open the script file in the associated editor. You can do this on all platforms using:
::pd_menucommands::menu_openfile {filename}
Or at least use that as example code for how to do it.
I have just got that working for pdlua in svn. Some notes:
A class must have a menu-open method before the Open item will be highlighted:
class_addmethod(our_class, (t_method)our_menu_open, gensym("menu-open"), A_NULL);
and the method itself:
static void our_menu_open(t_our_class *x)
calls sys_vgui("::pd_menucommands::menu_openfile {%s}\n", filename);
So the object needs to know the name of its script. For pdlua I added a field "_scriptname" in the lua side with an accessor "_whoami".
Martin
On Thursday, October 27, 2011 4:43 PM, "Martin Peach" martin.peach@sympatico.ca wrote:
On 2011-10-12 12:43, Hans-Christoph Steiner wrote:
Now that pdlua and tclpd are officially part of Pd-extended, I just had a little thought/feature request to make working with those objects easier. It would be very nice if you could right-click on the object, and click "Open" and have Pd open the script file in the associated editor. You can do this on all platforms using:
::pd_menucommands::menu_openfile {filename}
Or at least use that as example code for how to do it.
I have just got that working for pdlua in svn. Some notes:
A class must have a menu-open method before the Open item will be highlighted:
class_addmethod(our_class, (t_method)our_menu_open, gensym("menu-open"), A_NULL);
and the method itself:
static void our_menu_open(t_our_class *x)
calls sys_vgui("::pd_menucommands::menu_openfile {%s}\n", filename);
So the object needs to know the name of its script. For pdlua I added a field "_scriptname" in the lua side with an accessor "_whoami".
Martin
Ah, that's cool! That's cleaner than I thought it'd be, I thought it'd be some kind of ugly hack.
It would be really awesome if you could edit the file and have the object automatically updated. That would be a lot harder. I suppose using the file alteration monitor stuff in GNU/Linux and Mac OS X, you could efficiently get notification whether the file changed, but polling might not be so bad. I guess the hard part would be re-registering the object with Pd.
.hc
On 2011-10-27 19:07, Hans-Christoph Steiner wrote:
It would be really awesome if you could edit the file and have the object automatically updated. That would be a lot harder. I suppose using the file alteration monitor stuff in GNU/Linux and Mac OS X, you could efficiently get notification whether the file changed, but polling might not be so bad. I guess the hard part would be re-registering the object with Pd.
If the editor could send back to Pd the name of the file that was saved it would be much easier.
For now you could just save it under a new name and make one of those. Also the [pdluax] object loads its script each time it's instantiated so you can use the same name, although you still need to make a new object on the canvas.
OTOH dynamically changing the inlet/outlet count of an object especially when there are more than one in a patch would seem to guarantee crashing of Pd.
Martin
On 10/28/2011 03:06 PM, Martin Peach wrote:
OTOH dynamically changing the inlet/outlet count of an object especially when there are more than one in a patch would seem to guarantee crashing of Pd.
The ability to change the inlet/outlet configuration for already instantiated objects when reloading a script is something that I'd like to have for the pd-pure loader as well. I asked Miller about this at LAC in Cologne, but IIRC he didn't deem it feasible.
Albert
On 10/27/2011 10:43 PM, Martin Peach wrote:
I have just got that working for pdlua in svn. Some notes:
A class must have a menu-open method before the Open item will be highlighted:
class_addmethod(our_class, (t_method)our_menu_open, gensym("menu-open"), A_NULL);
Martin, thanks a bunch for this. I now added the same functionality to pd-pure (http://code.google.com/p/pure-lang/wiki/Addons#pd-pure).
Albert