doc • window

Window Life Cycle

Here is a little explanation of the birth and death of a window.

  1. There are two types of windows: real top-level windows and embedded windows (like the one embedded inside a tabstrip in the IDE).

  2. A window can be persistent or not. A non-persistent window is destroyed when you close it. A persistent window is just hidden.

  3. A window can be opened in modal (blocking) and non-modal (non-blocking) mode. The modal mode is implemented by using a local event loop. An embedded window opened in modal mode is temporarily made top-level.

  4. The first time a window is shown, an Open event is raised.

  5. A window can be closed by calling the Close method or by clicking on the close button of the window manager if the window is a top-level window.

  6. When a window is closed, a Close event is raised. If this event is not stopped, then the window is hidden. If the window is not persistent, it is destroyed too. If the window was opened in modal mode, then the local event loop used for implementing the modal mode is left.

  7. When a window has been closed, it can be opened again, and the Open event will be raised again.

  8. The integer argument of the Close method is returned by the ShowModal method.

  9. If you call Close during the Close event, the method does nothing.

  10. If you call Close during the Open event, the window is not opened.

  11. If you call Show or ShowModal while the window is being shown, the method does nothing.