This event is fired every time the user attempts to close a window. For any window, a named event is also fired. For example, window 'main' fires the event 'on_can_close_main_window', if the event is defined in script. If it doesn't exist, it fires the generic 'on_can_close_window' event.
If you are responding to the specific event, set the variable 'main_window_can_close' to True if the window is allowed to close and False if not. If you are responding to the generic event, set the variable 'window_can_close' accordingly. By default, this event will return 'True' if the variable is not changed.
script on_can_close_main_window is main_window_can_close := ask ('OK to close main window?', False) end script on_can_close_window is -- this handles all windows except 'main' window_can_close := ask ('OK to close this window?', False) end