Forums > MaxMSP

how to know when a subpatcher is opened

July 11, 2008 | 1:32 pm

Is it possible to check if a subpatcher is opened or closed?

I am looking for a solution similar to the ‘active’-object which will tell when a patcher window is active or not, but then if it is open or not.

And, related question: is it possible to remotely open or close a subpatcher?

Should I look into javascript-scripting, is it possible with that?

Thanks

Timo


July 11, 2008 | 1:57 pm

On 11 juil. 08, at 15:32, Timo Rozendal wrote:

>
> Is it possible to check if a subpatcher is opened or closed?

I don’t know if this is what you’re after, but I do this with [js] for
abstractions (it works with [patcher] too):

function visible ()
{
outlet (0,this.patcher.wind.visible);
}

> And, related question: is it possible to remotely open or close a
> subpatcher?

[pcontrol]? front to [thispatcher] ?

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://www.crfmw.be/max


July 12, 2008 | 1:43 pm

Thanks Patrick and Rabadja

Patrick, your [js] solution works, however, you still need to bang it get that ‘statusreport’ and I would like to get a signal when a subpatcher is opened (it doesn’t matter if it’s active then or not)

and about opening the subpatch remotely: yeah, of course that should be done with [thispatcher] and [front], thanks for reminding me,

Rabadja, thanks for the patch, that shows you can use [thispatcher] to open a subpatcher, but the first question is indeed a bit different.

Timo


July 14, 2008 | 12:13 am

active, closebang, onebang?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N vpatcher 822 615 1422 1015;
#P window setfont "Sans Serif" 9.;
#P newex 113 212 55 196617 print open;
#P newex 172 136 21 196617 t 0;
#P newex 113 157 21 196617 t 1;
#P newex 113 135 54 196617 onebang 1;
#P newex 98 111 41 196617 sel 0 1;
#P newex 157 89 53 196617 closebang;
#P newex 98 89 38 196617 active;
#P connect 0 0 2 0;
#P connect 2 1 3 0;
#P connect 3 0 4 0;
#P connect 5 0 6 0;
#P connect 4 0 6 0;
#P connect 1 0 3 1;
#P connect 1 0 5 0;
#P pop;
#P newobj 152 121 51 196617 p openme;
#P window clipboard copytext "p openme" #E;
#P window clipboard copycount 1;


July 14, 2008 | 7:58 am

raja schrieb:
> If, however, you are looking to be able to double-click on a

> subpatcher> type subpatch then you might be short-changing yourself
> out of the solution.

You can cover this case with the active object, as this will be
activeted by a double click and then be in front, but use a [sel 1] to
gate the nonactive notification. In addition with closebang you can
monitor if it has been closed again… As you usually have it always
once in front if you open it, these two objects should be suffcient to
track the state…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


Viewing 5 posts - 1 through 5 (of 5 total)