Intercepting Quit?

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Intercepting Quit?

Post by rrBUSS9EE » Wed Jun 25, 2014 11:22 pm

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.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Intercepting Quit?

Post by Simon » Thu Jun 26, 2014 12:11 am

Have you tried "close this stack" instead of "quit"?
I'm sure you get a closeStackRequest then.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Intercepting Quit?

Post by rrBUSS9EE » Thu Jun 26, 2014 12:17 am

My problem is the Quit command in the Application menu (or task switcher). Nothing seems to preempt that.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Intercepting Quit?

Post by Mark » Thu Jun 26, 2014 12:20 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

rrBUSS9EE
Posts: 98
Joined: Wed May 02, 2012 3:46 pm

Re: Intercepting Quit?

Post by rrBUSS9EE » Thu Jun 26, 2014 12:40 am

Thanks Mark... shutdownRequest is what I was looking for.

Post Reply