You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
446 B

function get_top_level_patcher()
{
var p = this.patcher;
while (p.parentpatcher) // If I have a parent, keep going up
{
p = p.parentpatcher;
}
return p;
// var prev = 0;
// var owner = this.patcher.box;
// while (owner) {
// prev = owner;
// owner = owner.patcher.box;
// }
// if (prev)
// // post("top patcher is",prev.patcher.name);
// return prev.patcher;
}