G4P action on closing a window

edited November 2013 in Library Questions

hi, I'm using g4p to show an option window. but I can't find how to run a function when I close this window. I set windControl.setActionOnClose(GWindow.CLOSE_WINDOW); But how can I capture the close event if the cross in the right top window corner is clicked?

anyone an idea?

thanks KS

Answers

  • Answer ✓

    but I can't find how to run a function when I close this window

    Unfortunately G4P doesn't have support for that directly. I suggest that your option window uses the KEEP_OPEN option and add a button to your window which when clicked executes your function then closes the window with the forceClose() method.

  • that works for me. thank you quark!

Sign In or Register to comment.