OnEnd

BlitzMax Forums/BlitzMax Programming/OnEnd

Perturbatio(Posted 2005) [#1]
is it new or am I just blind and it's always been there?


Red(Posted 2005) [#2]
- onEnd was always been there
- apptitle is new feature


Perturbatio(Posted 2005) [#3]
Do you know if there's a way to halt the ending of BMax app once this is called? (i.e. when someone clicks the X and you want to prevent a close until they confirm).


Red(Posted 2005) [#4]
The OnEnd purpose is not to halt app ending.

Blitz app has no X icon.
There's no event for close icon.


fredborg(Posted 2005) [#5]
Apparently you need to reestablish the OnEnd when it's been triggered once.
Graphics 640,480,0,0
	
OnEnd(quit)
main()

Function main()

	Repeat
		Cls
		DrawText "Press Escape!",10,10
		Flip
		Delay 100
	Until KeyHit(KEY_ESCAPE)
	
EndFunction

Function quit()

	ret = Proceed("Really quit?")
	If ret<>1
		OnEnd(quit)
		main()
	EndIf

EndFunction



Perturbatio(Posted 2005) [#6]
thanks :)
I had kinda figured it out already but I forgot to reset my ended flag and didn't realise you need to reinsert your onEnd function.


Perturbatio(Posted 2005) [#7]
I added a modification of your code to the wiki.