How to Quit with a button

William Prothero prothero at earthednet.org
Mon Dec 8 16:30:58 EST 2014


Richard:
Thanks for the input. I’ll stop messing with the doMenu approach. I’ve tried a number of things to get my app to shut down without crashing the app. I know it must be possible because the toolbar menu quits fine. I may just stop trying to use a script to quit. It’s not essential since the toolbar menu quits fine. Anyway, I’ve tried locking messages, closing all substacks, delaying the “quit” with a send command, and it crashes no matter. But, a bare stack works fine. I wonder if I’ve come against some other bug in V7.0.1 that the quit command triggers. Anyway, it’s too complex for me to worry about at this stage, so unless there are other bright ideas about what might be happening, I’m going to remove the quit button.
Best,
Bill

On Dec 8, 2014, at 1:13 PM, Richard Gaskin <ambassador at fourthworld.com> wrote:

> William Prothero wrote:
> 
>> I got no response from the doMenu command, so perhaps I needed
>> to include the shortcut key in the name?
> 
> DoMenu is pretty limited in LiveCode.  It was necessary in HyperCard because that language wasn't rich enough to build an entire IDE in, so the only way you could invoke some of the IDE features was through "doMenu" as a sort of catch-all.
> 
> In LiveCode of course the IDE is make in its own language, so anything you see in the IDE can be done more directly in your own stacks than having to rely on a generic catch-all.
> 
> If you do need to trigger an IDE menu item, you can dispatch a menuPick handler to the relevant menu button in revMenubar with the name of the menu item as its param.
> 
> But quit is very essential - every app needs it - so that's built right into the language with the "quit" command.
> 
> If you need to do any processing before the app actually quits, you can trap the shutdownRequest message.
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> LiveCode training and consulting: http://www.fourthworld.com
> Webzine for LiveCode developers: http://www.LiveCodeJournal.com
> Follow me on Twitter: http://twitter.com/FourthWorldSys
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list