dispose message with thispatcher in subpatch deletes it in master patch
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 ?
If you're opening [patcher]s or abstractions from within your main patch then try [pcontrol].
lh
dispose will effectively kill your patcher. You can either use pcontrol object as suggested by Luke, or use the wclose message to thispatcher.
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 ?
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
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.
+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!
I'll add the proper stuff to the refpage.
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.
That would be [active].
lh
Sure isn't undocumented. Refpage and help file....
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...
@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. ;)
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.
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.
Hi I am wanting to close the current patch, I thought 'dispose' is for doing this.