Newbie question about exiting app ...
BlitzMax Forums/BlitzMax Beginners Area/Newbie question about exiting app ...
| ||
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 |
| ||
Use AppTerminate() to check the close button at the top of the window, but I don't know about the menu bar. |
| ||
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 |
| ||
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 :) |
| ||
"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 |
| ||
Graphics 800, 600 Repeat Cls;Flip Until KeyDown(KEY_ESCAPE) Or AppTerminate() |