I’m having some trouble getting information about the parentpatcher of an object in a subpatcher.
If I have an object in a subpatcher or an abstraction and it calls jpatcher_get_parentpatcher(), I get a NULL pointer. However, if I open the subpatcher window and instantiate the object again, I get the parentpatcher’s address.
Any thoughts on this? Is it that I’m doing something wrong or is there a bug in jpatcher_get_parentpatcher()? I’d really appreciate any suggestions about how to do this properly or, if indeed it is a bug, a possible workaround.
On Jan 14, 2009, at 2:46 PM, John MacCallum wrote:
> I’m having some trouble getting information about the parentpatcher
> of an object in a subpatcher.
Sounds like you might be calling this in your object constructor,
before the patcher has finished loading (and before these patcher
attributes have been set). You’ll need to cache #P in your constructor
and then call after the object has been instantiated (say in loadbang,
or response to a bang message, etc.).