detect when user closes subpatch window

mharter's icon

I'd like to find out when a user closes a subpatch window so that I can turn off a few gui features to improve overall performance.

Thanks much!

Roman Thilenius's icon

basically [closebang], and in your case probably with a [send].

mharter's icon

Thanks Roman, that worked to detect the window close, but loadbang does not work to detect opening because all of the subpatch loadbangs happen when the parent is loaded. I created a button that opens the subpatch window using [pcontrol], and set the "MySubpatchIsOpen"flag too. I hide the subpatch so that the user can't double-click to open, thereby bypassing the setting of the flag.

mharter's icon

vanille:

[active] is great! I had never discovered it. Thanks so much for the info.

MH

Roman Thilenius's icon

be warned [active] can be very tricky during programming. whenever you
change something releated to it, you have to restart the patcher.