Shutdownrequest getting lost with substacks

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

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
digitalopps
Posts: 3
Joined: Tue Apr 30, 2013 1:35 pm

Shutdownrequest getting lost with substacks

Post by digitalopps » Tue Apr 30, 2013 1:47 pm

Hi all,

I've got a shutdown request handler that used to work fine in my standalone application. However, I've added two new stacks that appear as popups, with their own, unique menu bars - and now the app won't quit. The handler is as follows:

on shutdownRequest
showQuitMessage
dosave
hideQuitMessage
closeEverything
pass shutdownRequest
end shutdownRequest

If I launch the standalone and don't open a popup stack, it quits fine. But after either or both of the popup stacks have opened, it fails to quit.

I've used some alert messages to trace how far it gets: two lines into the showQuitMessage handler and thats it.

I've read that shutdown request can be tricky when using substacks and I've tried putting the above handler in the back, but it made no difference.

Anyone got any ideas?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10337
Joined: Wed May 06, 2009 2:28 pm

Re: Shutdownrequest getting lost with substacks

Post by dunbarx » Tue Apr 30, 2013 2:11 pm

Hi.

I cannot see why this would matter, but does it make any difference at all if, in your two substacks, you write:

on shutDownRequest
pass shutDownRequest
end shutDownRequest

and see if the message makes it to those handlers? Certainly for some reason it is being waylaid.

Craig Newman

digitalopps
Posts: 3
Joined: Tue Apr 30, 2013 1:35 pm

Re: Shutdownrequest getting lost with substacks

Post by digitalopps » Tue Apr 30, 2013 2:27 pm

Hi Craig,

Thanks for the idea, sadly it made no difference.

I've tried putting all the stack scripts into a button, then loading that into the back on preOpenstack - but when I try that none of my onscreen buttons etc. can find their handlers. (I thought scripts in the back were accessible to everything?)

Any other ideas appreciated...

digitalopps
Posts: 3
Joined: Tue Apr 30, 2013 1:35 pm

Re: Shutdownrequest getting lost with substacks

Post by digitalopps » Tue Apr 30, 2013 2:31 pm

Some more info - if I launch the standalone and quit without opening a popup stack, it quits but doesn't pass the shutdown request to the other stacks (presumably because they're not active?)

If I open either stack, the app no longer quits but the shutdown request still doesn't get to them.

Post Reply