Yes, you're right. But was about to handle it as a button_down(id) ? In fact, in SDL, it's kinda the case because you handle a SDL_QUIT event.
By RunnerPack
Date 2015-12-11 02:12
Edited 2017-01-22 13:14
The callback would only be used to check whether closing should be allowed. It could set appropriate flags - so that the "Really quit?" dialog could be shown - then cancel the close. Other logic could then call "Window#close" when the decision to close has been made. Even if "Window#close" also triggers the callback (and I'm not sure it should), you could just set whatever flag the code in the callback checks so that it allows the window to close as normal. That's my take on it, anyway...
BTW, I think the callback should simply be called "closed".
EDIT:
I've thought about it some more. I think it would be more Ruby-ish to call it Window#close?
.
Perhaps Gosu could even pass an argument indicating the reason for closing (e.g. the "X" button was clicked, the computer wants to shut down, Window#close was called, etc.).