quiting and close stack message

102 views
Skip to first unread message

william humphrey

unread,
Dec 8, 2010, 12:33:32 PM12/8/10
to How to use LiveCode
How do you get an answer dialogue to halt the quit process? If you have a
"close stack" handler and it has a "do you really want to quit?" dialogue
and you quit the livecode application you see that answer message flash for
a second but it doesn't halt the quit process.
_______________________________________________
use-livecode mailing list
use-li...@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

william humphrey

unread,
Dec 8, 2010, 1:44:16 PM12/8/10
to How to use LiveCode
Maybe this doesn't work in the IDE but is possible in a saved application?

On Wed, Dec 8, 2010 at 1:33 PM, william humphrey <bi...@bluewatermaritime.com
> wrote:

> How do you get an answer dialogue to halt the quit process? If you have a
> "close stack" handler and it has a "do you really want to quit?" dialogue
> and you quit the livecode application you see that answer message flash for
> a second but it doesn't halt the quit process.


--
http://www.bluewatermaritime.com

Bob Sneidar

unread,
Dec 8, 2010, 1:57:36 PM12/8/10
to How to use LiveCode
Intercept the shutDownRequest message and only pass it if the user confirms?

Bob

william humphrey

unread,
Dec 8, 2010, 2:07:15 PM12/8/10
to How to use LiveCode
Exactly. That is what I'm trying to do. Can that be done and tested in the
IDE?

--
http://www.bluewatermaritime.com

william humphrey

unread,
Dec 8, 2010, 2:11:01 PM12/8/10
to How to use LiveCode
*This doesn't work:*

*
*

*on* shutdownRequest

answer "are you sure you want to quit"

*end* shutdownRequest

FlexibleLearning

unread,
Dec 8, 2010, 2:25:12 PM12/8/10
to use-li...@lists.runrev.com
'quit' cannot be terminated once issued. See 'closeStackRequest' instead of
'closeStack'.

Hugh Senior
FLCo

How do you get an answer dialogue to halt the quit process? If you have a
"close stack" handler and it has a "do you really want to quit?" dialogue
and you quit the livecode application you see that answer message flash for
a second but it doesn't halt the quit process.

Bob Sneidar

unread,
Dec 8, 2010, 2:26:11 PM12/8/10
to How to use LiveCode
It looks like this is meant for a standalone only. Quitting the IDE does not seem to send a shutdownRequest to the stack script.

Bob

Bob Sneidar

unread,
Dec 8, 2010, 2:53:44 PM12/8/10
to How to use LiveCode
Hi Hugh. CloseStackRequest does not prevent quitting in the IDE. It appears nothing does. I suspect however that it would work in a standalone. I will test that shortly.

Bob

Bob Sneidar

unread,
Dec 8, 2010, 3:02:40 PM12/8/10
to How to use LiveCode
Ok I have determined that intercepting the closeStackRequest or the shutDownRequest in the IDE does NOT prevent quitting the IDE. However, intercepting closeStackRequest DOES prevent a standalone from quitting if not passed! Intercepting closeStackRequest, while I am sure it would prevent closing the stack does NOT prevent the app from quitting.

I hope that clears things up for everyone.

Bob


On Dec 8, 2010, at 11:25 AM, FlexibleLearning wrote:

FlexibleLearning

unread,
Dec 8, 2010, 4:27:29 PM12/8/10
to use-li...@lists.runrev.com
Bob,

As I said, 'quit' is non-negotiable. Trap a closeStackRequest in the main
stack's card script and offer the option to abort...

--| Main stack, card script
on closeStackRequest
checkQuit
end closeStackRequest

--| Main stack, stack script
on checkQuit
answer "Are you sure you want to quit?" with "Yes" or "No"
if it="Yes" then quit
end checkQuit

You can use the same handler in your File menu...

on menuPick which
if which="Quit" then checkQuit
end menuPick

and in your shortcuts handler thus...

on commandKeyDown pKey
if pKey="Q" then checkQuit
end commandKeyDown


Hugh Senior
FLCo

Hi Hugh. CloseStackRequest does not prevent quitting in the IDE. It appears
nothing does. I suspect however that it would work in a standalone. I will
test that shortly.

Bob

Bob Sneidar

unread,
Dec 8, 2010, 5:12:23 PM12/8/10
to How to use LiveCode
Oh hey I didn't think about trapping for the menuPick and command key. Good idea.

Bob

J. Landman Gay

unread,
Dec 8, 2010, 5:35:52 PM12/8/10
to How to use LiveCode
On 12/8/10 4:12 PM, Bob Sneidar wrote:
> Oh hey I didn't think about trapping for the menuPick and command key. Good idea.

Have you looked at trapping the shutdownRequest message?

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com

Bob Sneidar

unread,
Dec 8, 2010, 5:57:12 PM12/8/10
to How to use LiveCode
Well that is odd. It seems to work now. I tested this in the IDE, which quit when I hit CMD-Q without popping a dialog, but worked a peach as a standalone. Now it's working in the IDE as well!

I blame Gremlins!

Bob

william humphrey

unread,
Dec 8, 2010, 9:07:07 PM12/8/10
to How to use LiveCode
I couldn't get it to work in the IDE but I'll try again now. Seems to me it
would be nice if things like this worked consistently in IDE and standalone
even if LiveCode programmers had to introduce something to accomplish it.

J. Landman Gay

unread,
Dec 8, 2010, 10:29:50 PM12/8/10
to How to use LiveCode
On 12/8/10 8:07 PM, william humphrey wrote:
> I couldn't get it to work in the IDE but I'll try again now. Seems to me it
> would be nice if things like this worked consistently in IDE and standalone
> even if LiveCode programmers had to introduce something to accomplish it.

It can't work in the IDE the way you want, because the IDE traps the
message in order to ask you if you want to save your own stacks. :) If
you want to test it in the IDE, select "Suspend Development Tools" from
the Development menu. That will remove the IDE from the message path and
it should work in your stack.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com

_______________________________________________

Malte Brill

unread,
Dec 9, 2010, 4:55:53 AM12/9/10
to use-li...@lists.runrev.com
Ok,

I seem to be too dumb for this...

Can anyone point me to the settings I have to make to ensure my project launches on the device I want in the simulator? I had it launch in the iPad one only. Now it only launches in the old iPhone one. Going nuts over here.

all the best,

Malte

william humphrey

unread,
Dec 9, 2010, 11:25:52 AM12/9/10
to How to use LiveCode
Thanks. I read this list every day and often marvel at how lucky I am to be
using liveCode which has the resources of the list, people that don't mind
pointing out obvious answers to lifetime neophytes like me.

On Wed, Dec 8, 2010 at 11:29 PM, J. Landman Gay <jac...@hyperactivesw.com>wrote:

> On 12/8/10 8:07 PM, william humphrey wrote:
>
>> I couldn't get it to work in the IDE but I'll try again now. Seems to me
>> it
>> would be nice if things like this worked consistently in IDE and
>> standalone
>> even if LiveCode programmers had to introduce something to accomplish it.
>>
>
> It can't work in the IDE the way you want, because the IDE traps the
> message in order to ask you if you want to save your own stacks. :) If you
> want to test it in the IDE, select "Suspend Development Tools" from the
> Development menu. That will remove the IDE from the message path and it
> should work in your stack.
>
>
>
--

http://www.bluewatermaritime.com

David C.

unread,
Dec 9, 2010, 12:07:00 PM12/9/10
to How to use LiveCode
On Thu, Dec 9, 2010 at 10:25 AM, william humphrey
<bi...@bluewatermaritime.com> wrote:
> Thanks. I read this list every day and often marvel at how lucky I am to be
> using liveCode which has the resources of the list, people that don't mind
> pointing out obvious answers to lifetime neophytes like me.

...and/or virtual "noobs" like myself.

Simply good folks. :-)

Best regards,
David C.

Bob Sneidar

unread,
Dec 9, 2010, 12:22:00 PM12/9/10
to How to use LiveCode
Try being a Techno-Twit like me for a day and see how you like it! ;-)

Bob

J. Landman Gay

unread,
Dec 9, 2010, 2:29:18 PM12/9/10
to How to use LiveCode
On 12/9/10 10:25 AM, william humphrey wrote:
> Thanks. I read this list every day and often marvel at how lucky I am to be
> using liveCode which has the resources of the list, people that don't mind
> pointing out obvious answers to lifetime neophytes like me.

I marvel too. We all have our areas of expertise, and I'm as noob as
anyone in some of them. Don't ask me to debug your database. :)

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com

_______________________________________________

Reply all
Reply to author
Forward
0 new messages