I want to get a reference to the closest instance of my external, traversing upward, from inside a poly~. The code I've been using to do so from subpatchers/abstractions doesn't work:
p = (t_patcher *)((t_symbol *)gensym("#P"))->s_thing; // get patcher
Then later, after patcherargs fires:
if((b = (t_box *)p->p_vnewobj) != NULL) // get patcher's box
pp = b->b_patcher; // get box's patcher
So either an instance of an abstraction in poly~ doesn't have a patcher, or the patcher's box doesn't correspond to the poly~'s box.
How do I go about getting the poly~'s box/patcher? Is this possible?
A js object within that poly~ can successfully traverse the patcher heirarchy upward via this.patcher.parentpatcher, so I assume so, but I'd rather avoid attaching a js to my external's outlet to do this (a js created behind the scenes with newinstance() doesn't appear to have a patcher).