Parent unlocked

Tj Shredder's icon

Is there way to find out if the parent patcher is locked or unlocked?

I have a lot of bpatchers which adapt to their size. I could poll the size while a patcher is unlocked, to adapt automatically whenever the size of the bpatcher is changed. Of course this would eat a lot of unnecessary CPU cycles when the patcher is in normal use...

Stefan

11OLSEN's icon

i reckon it's no problem with js. somehow with the "parentpatcher" and "locked" properties. someone else needs to help here.
O.

from inside the parentpatcher it's easy.

function bang() {
outlet(0,this.patcher.locked);
}

Luke Hall's icon

function bang() {
if (this.patcher.parentpatcher) {
outlet(0,this.patcher.parentpatcher.locked);
}
}