Re: Can't quit from Dock or cmd-Q
Re: Can't quit from Dock or cmd-Q
- Subject: Re: Can't quit from Dock or cmd-Q
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 25 Oct 2002 09:30:35 -0700
On 10/25/02 6:10 AM, "has" <email@hidden> wrote:
>
You've _almost_ got it.
>
>
In an event-driven OO system (e.g. a GUI app), you'd probably do it all via
>
messaging: dispatching a finishUpNow() message that's passed from active
>
component [object] to active component so that they all shut down in an
>
ordered fashion.
>
>
In a batch-processing procedural system (as yours presumably is), you've
>
got the right idea: have a global finishUpNow flag that active components
>
[subroutines] periodically poll during their normal operation. If that flag
>
changes to true, each component should finish up at its earliest
>
convenience and return control to its caller. (Not every subroutine needs
>
to poll finishUpNow, of course, just the main ones which drive the system.)
>
>
======================================================================
>
>
-------
>
--FLAGS
>
>
global _stop
>
>
-------
>
--MAIN ROUTINES
>
>
on doSubProcess()
>
beep
>
end doProcess
>
>
on doProcess()
>
repeat 10 times -- cannot be interrupted; must be allowed to complete
>
doSubProcess()
>
end repeat
>
end doProcess
>
>
on main()
>
repeat until _stop -- safe to stop at any time
>
doProcess()
>
end repeat
>
end main
>
>
-------
>
--EVENTS
>
>
on run
>
set _stop to false
>
main()
>
end run
>
>
on quit
>
set _stop to true
>
continue quit
>
end quit
>
>
======================================================================
I've been trying to explain, from the beginning, that 'continue quit' DOES
NOT WORK in non-stay-open applications. It is ignored. I thought you told me
that 'this is not a bug and it's always been that way'. So why are you
including it?
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.