Newbie question about exiting app ...

BlitzMax Forums/BlitzMax Beginners Area/Newbie question about exiting app ...

mic_pringle(Posted 2009) [#1]
Hi,

I currently exit the game I'm working on by testing for the escape key and then exiting the main loop.

However, what I'd like to do is switch this to use both the little 'x' button in the top left of the window, and also 'quit' from the menu bar menu.

Is this possible (as currently they don't work), and if so how ?

I'm developing on a Mac.

Thanks

-ic


Warpy(Posted 2009) [#2]
Use AppTerminate() to check the close button at the top of the window, but I don't know about the menu bar.


Arabia(Posted 2009) [#3]
I'm still very new to BM, I just wait for ESC to exit programs at the moment. But I'd imagine you simply use the END command


Arabia(Posted 2009) [#4]
Can you post some code that you are working on by chance? I'll give it a go for you, and if I can't, I'm sure someone will help you out with the answer shortly :)


jkrankie(Posted 2009) [#5]
"if appterminate() then end" would kill the app immediately, but it's better to have something like "if appterminate() then exit=true", where exit is the variable that controls whether you are in the main loop.

Cheers
Charlie


Enyaw(Posted 2009) [#6]
Graphics 800, 600

Repeat
Cls;Flip
Until KeyDown(KEY_ESCAPE) Or AppTerminate()