Is there a way to do something (let's say close a file, kill a
subprocess etc...) before quitting pd (meaning Ctrl+Q or File - Quit)?
Thanks
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2013-12-18 12:22, puredata@11h11.com wrote:
Is there a way to do something (let's say close a file, kill a subprocess etc...) before quitting pd (meaning Ctrl+Q or File - Quit)?
there is [closebang], which will send out a bang before a patch is "closed" (Ctrl-W). if you are familiar to writing externals, it's an equivalent of the "free"-method. unfortunately [closebang] cannot be implemented as a pure external (as it requires some changes to Pd's core infrastructure), and it has never been included with Pd-vanilla. there is a patch pending at sourceforge [1]. afaik [closebang] and it's cousin [initbang] are included in Pd-extended.
but this is only half of the truth...when *quitting* Pd (instead of closing a single top-level-patch, or deleting an object), for some obscure reasons Pd does *not* call the free-methods of it's objects, so (afair) [closebang] doesn't work either.
luckily, there is a fix for this [2], so [closebang] might work. unfortunately, this has never been included in Pd-vanilla. afaik it has been included in Pd-extended.
admsr IOhannes
[1] https://sourceforge.net/p/pure-data/patches/93/ [2] https://sourceforge.net/p/pure-data/patches/82/
hi,
[closebang] is maybe called but when using Ctrl+Q my shell bang is not
execute (using something like [kill -9 xxx< - [shell]).
trying to use hcs - noquit:
ERROR: can't rename "menu_quit": command doesn't existwhile
executing"rename menu_quit old_menu_quit "("uplevel" body line
5)invoked from within"uplevel #0 $cmds_from_pd"
this is with pd-extended.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2013-12-18 18:26, puredata@11h11.com wrote:
hi,
[closebang] is maybe called but when using Ctrl+Q my shell bang is not execute (using something like [kill -9 xxx< - [shell]).
well, first make sure that [closebang] does get called. e.g. start Pd with "-stderr" and print something to stderr.
trying to use hcs - noquit:
what's it supposed to do?
you can configure the kiosk plugin [1] to (only) intercept Quit-shortcuts (Ctrl-q, Ctrl-Q) and disable the menu.
fgamsdr IOhannes
[1] https://svn.code.sf.net/p/pure-data/svn/trunk/guiplugins/kiosk-plugin