Re: Execute on Exit?
- To: mathgroup at smc.vnet.net
- Subject: [mg107413] Re: Execute on Exit?
- From: Chris Degnen <degnen at cwgsy.net>
- Date: Fri, 12 Feb 2010 04:40:35 -0500 (EST)
- References: <hktr79$kqm$1@smc.vnet.net> <hl0lco$r72$1@smc.vnet.net>
Thanks. Actually I got most of the way there. I just added FrontEndExecute[FrontEndToken["FrontEndQuit"]]; to the end of the function I wanted to run, then added a menu bar item to run the function. E.g. to ...\SystemFiles\FrontEnd\TextResources\Windows\MenuSetup.tr I added: Item["Exit", KernelExecute[Get["CustomFunction`"]], MenuEvaluator->Automatic] I would like to place the menu item over on the right, under the window-close button on the frame. I tried Alignment->Right but it won't budge. Any suggestions? Szabolcs Horv=E1t wrote: > Chris Degnen wrote: > > > Hi. Is it possible to run a command upon system close? > > > The 'close' menu binding is customisable but doesn't seem to > > accept a sequence of tokens, e.g. Item["E&xit", > > KernelExecute[CustomFunction[]]; "FrontEndQuit"] > > > The top-right close button isn't affected by the menu binding though. > > $Epilog is evaluated on kernel quit. I don't think there is anything > similar for the front end quit.