<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css">
<title>
Gambas Documentation - Window Life Cycle
</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../help+en"><img class="flag" alt="Home" border="0" src="../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../doc+en">Up</a>&nbsp;
<a href="network+en">Previous</a>&nbsp;
<a href="window-activate+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
Window Life Cycle
</h1>
Here is a little explanation of the born and death of a window.
<p>
<ol>
<li>There are two types of windows: real top-level windows and embedded windows (like the one embedded inside a tabstrip in the IDE).
<p>
<li>A window can be persistent or not. A non-persistent window is destroyed when you close it. A persistent window is just hidden.
<p>
<li>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.
<p>
<li>The first time a window is shown, an <a href="../comp/gb.qt/window/_open+en">Open</a> event is raised. Only the first time, i.e. it will be raised once for each instance of a window.
<p>
<li>A window can be closed by calling the <a href="../comp/gb.qt/window/close+en">Close</a> method or by clicking on the close button of the window manager if the window is a top-level window.
<p>
<li>When a window is closed, a <a href="../comp/gb.qt/window/_close+en">Close</a> 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.
<p>
<li>When a window has been closed, it can be opened again, but the <a href="../comp/gb.qt/window/_open+en">Open</a> event won't be raised again. On the contrary, the <a href="../comp/gb.qt/window/_close+en">Close</a> event will be raised systematically.
<p>
<li>The integer argument of the <a href="../comp/gb.qt/window/close+en">Close</a> method is returned by the <a href="../comp/gb.qt/window/showmodal+en">ShowModal</a> method.
<p>
<li>If you call <a href="../comp/gb.qt/window/close+en">Close</a> during the <a href="../comp/gb.qt/window/_close+en">Close</a> event, the method does nothing.
<p>
<li>If you call <a href="../comp/gb.qt/window/show+en">Show</a> or <a href="../comp/gb.qt/window/showmodal+en">ShowModal</a> while the window is being shown, the method does nothing.
</ol>

</div>
</body>
</html>

