Forums > MaxMSP

dispose message with thispatcher in subpatch deletes it in master patch

February 2, 2010 | 1:45 am

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 ?

February 2, 2010 | 2:15 am

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


February 2, 2010 | 10:35 am

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

February 3, 2010 | 7:40 pm

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 ?

February 4, 2010 | 11:56 am

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 ;-)


February 5, 2010 | 9:06 pm

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.

February 7, 2010 | 9:25 am


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

February 7, 2010 | 3:01 pm

I’ll add the proper stuff to the refpage.

February 7, 2010 | 5:42 pm

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?


February 7, 2010 | 6:27 pm

That would be [active].


February 7, 2010 | 8:46 pm

Sure isn’t undocumented. Refpage and help file….

February 8, 2010 | 12:46 pm

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…

— Pasted Max Patch, click to expand. —
February 8, 2010 | 2:32 pm

@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. ;)

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

Forums > MaxMSP