[futurebasic] Re: [FB] Don't quit at Quit

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2016 : Group Archive : Group : All Groups

From: Brian S <fblistserve@...>
Date: Sun, 13 Nov 2016 09:09:51 -0700
> On Nov 13, 2016, at 5:50 AM, Bernie <bernie.fblist@...> wrote:
> Eugen wrote:
>> I want to avoid / annihilate the result of the Quit command (or cmd-Q).
>> In other terms, after I change in my app, whenever I make a change in my app, an alest message appeares that asks me if I want to save, to cancel or don't change.
>> How can I cancel the quit command and to return to my app, without quit the app.
>> Ex:
>> '-------------------------------------------
>> LOCAL FN MyWindowHandler( nextHandler as EventHandlerCallRef, theEvent as EventRef, userData as pointer )
>> '~'1
>> CASE 2'Cancel saving file and don't quit the app --> here is the problem
> Without seeing a runnable example, I wonder if this will do it?
> 	gFBQuit = _false

I don’t understand your goal(s) in this one piece of processing and how they fit into overall program goals. Presumably quitting the app is desirable at some point even though it isn’t needed in this localized case. My first reaction is: use an alert dialog with only the options needed ( i.e. remove the quit option from the dialog ). NavDialog examples can do this( but no way to know how fn ThreeBtnAlert operates without a runnable demo ). 

Typically gFBQuit is only set to true when the user picks the app Quit option( or similar option to quit ) and is one global the FB runtime uses to make those decisions. My suggestion would be to only set this global to _zTrue when a quit is desired and otherwise leave it.