From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
The Termination Process in GUI Applications
This is the order in which events are called when a GUI application initiates a termination process, i.e. when it quits:
- DesktopApplication.CancelClosing is called first. If, for any reason, you want to stop the termination process or interact with the user (use a modal window in such a case) to confirm, you should do it in this event. If you return True, the termination process will be stopped immediately.
- DesktopWindow.CancelClosing is then called for each DesktopWindow, one after the other. If any DesktopWindow.CancelClosing returns True, the termination process will be stopped.
- Windows are all closed, one after the other. In the process, each Window.Close event is called but you can no longer interrupt the termination process.
- If you use asynchronous object like Threads, Timers or sockets, they are terminated by the runtime environment then destroyed even if the runtime did not or could not stop them. If such objects are subclasses and have a Destructor event, it will be called.
- The DesktopApplication.Closing event is called.