G4P OnWindowClose handler to execute or not?

From early on in the life, G4P had the capability to create multiple windows and the user could specify what to do when someone clicked on the red button/cross on the window menu bar. Those options are
a) Ignore and keep the G4P window open
b) Close the G4P window
c) Exit the application

There is also the option to define an on-close-handler method to process any data (e.g. save it to disk) when the window was closed i.e. option (b) above.

My question is this:

Should this method be executed when the G4P window is using option (c), in other words the application is exited?

I can see an argument for both cases and I am trying to decide which to use in the next version of G4P (PS3 compatible) I am working on.

Your thoughts are welcome. ~O) :-?

Answers

  • edited September 2015 Answer ✓

    Hmn... interesting question. Personally, I would rename the callback method to something like on-user-clicked-close-handler and don't execute it when option (c) is beeing used.

  • G4P GWindow class has a method called

    addOnCloseHandler (object, method-name)

    so the user specifies the name of the callback method and the object that handles it. I have been thinking about this and have decided that, as you suggest, it is only executed with option (b). This will mean it will behave the same as the current version of G4P.

    Thanks for your feedback :)

  • edited September 2015

    No problem! Great I could help. Looking forward to G4P's release. ;)

Sign In or Register to comment.