dispose message with thispatcher in subpatch deletes it in master patch

Frédéric Chiasson's icon

I use "front" and "dispose" messages to make a subpatch appear on screen. "front" works well. "Dispose" does close the subpatch, but the subpatch object in the master patch also disappear. Is that a normal behavior ?

Luke Hall's icon

If you're opening [patcher]s or abstractions from within your main patch then try [pcontrol].

lh

Emmanuel Jourdan's icon

dispose will effectively kill your patcher. You can either use pcontrol object as suggested by Luke, or use the wclose message to thispatcher.

Frédéric Chiasson's icon

wclose, that's what I wanted to know. Thanks guys!

I didn't find the list of these messages in the thispatcher reference patch, although there is a complete list of "script" messages. Did I miss something in the reference pages ?

pdelges's icon

Well well, I'm happy you complain. I'm afraid you didn't miss anything...

I already wrote about this documentation problems several times on this forum, but without any result so far. Let's hope someone is now listening ;-)

p

pseudostereo's icon

I've run into this problem too.

The help file for thispatcher specifies 'dispose' to close the patcher window. No mention of 'wclose' in either the help or the reference. Not only does a 'dispose' message delete the subpatch object, an undo won't bring the subpatch back (presumably because it was deleted via the message).

So if you haven't saved your master patch before you unwisely sent the (recommended) 'dispose' message to your carefully crafted subpatch, you've just lost everything. And you can't get it back.

This is not trivial - it's exactly the kind of thing that scares people away from Max. And you can find complaints about this particular problem dating back 2 years. I can't think of any excuse for why this hasn't been fixed.

seejayjames's icon

+1

"wclose" should be on the main help page, and "dispose" could also be there, but not connected for safety (like "kill" for jit.qt.movie)... and there should be a bright red warning label for it!

Gregory Taylor's icon

I'll add the proper stuff to the refpage.

sixtin's icon

On a similar/related note:

What's the object called for checking if a patcher is the frontmost? It's an undocumented object so I can't find it. Does it still exist in Max5?

Thanks.

Luke Hall's icon

That would be [active].

lh

Gregory Taylor's icon

Sure isn't undocumented. Refpage and help file....

Tj Shredder's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This could be the corrected help file. The dispose message is good for the reference but bad for the help file. People tend to copy from help files which should be encouraged on all levels, the dangerous parts don't need to be there...

sixtin's icon

@Luke Hall

Thanks! That's two problems you've helped me with in as many posts.

@Gregory Taylor

My bad, yeah it is documented. I must be confusing it with something else. Thanks for putting me in my place on that one. ;)

orange_glass's icon

Hi I couldn't find dispose in the help file. I have tried like this

I am wanting to close the current patch, ideally without a 'are you sure' / save dialogue.

Roman Thilenius's icon

not sure what you think "script dispose" will script.

but to get rid of the are-you-sure message you would send "clean" to thispatcher. this makes it think that the current state has already been saved.

orange_glass's icon

Hi I am wanting to close the current patch, I thought 'dispose' is for doing this.