Page 1 of 1
Intercepting Quit?
Posted: Wed Jun 25, 2014 11:22 pm
by rrBUSS9EE
I have a server app (standalone) I have been asked to confirm on quit, but can't figure out what should be simple.
Initially tried in closeStack->exit closeStack... no good..
...then found closeStackRequest, but that only works when physically closing the stack's window (Quit menu item still shuts it down).
So how does one do this in LiveCode?
Thanks.
Re: Intercepting Quit?
Posted: Thu Jun 26, 2014 12:11 am
by Simon
Have you tried "close this stack" instead of "quit"?
I'm sure you get a closeStackRequest then.
Simon
Re: Intercepting Quit?
Posted: Thu Jun 26, 2014 12:17 am
by rrBUSS9EE
My problem is the Quit command in the Application menu (or task switcher). Nothing seems to preempt that.
Re: Intercepting Quit?
Posted: Thu Jun 26, 2014 12:20 am
by Mark
Hi,
Do you mean that you have created an app based on LiveCode Server, or do you mean that you have created a faceless app that is started e.g. from the commandline with the -ui option or do you mean that you have a GUI app that functions like a server?
A script that is executed by LiveCode server just exits when it is completed. I don't think that intercepting quit makes sense.
A faceless app just quits when it finishes too, unless it is started as a process. Why would you want to intercept the quit command in such an app?
A GUI app is able to intercept the quit command using the shutdownRequest message. If you don't pass the shutdownRequest message, the standalone won't guit.
Kind regards,
Mark
Re: Intercepting Quit?
Posted: Thu Jun 26, 2014 12:40 am
by rrBUSS9EE
Thanks Mark... shutdownRequest is what I was looking for.