[Gambas-user] Problem with Window.Close()

Benoit Minisini gambas at ...1...
Wed Aug 16 12:07:23 CEST 2006


Hi,

Here is a new patch for 1.9.38 that should solve the problem with the closing 
of windows. Tell me if it works, and sorry for the inconvenience!

I write here the "rules of closing" for those who are interested. You will see 
the complexity of the situation!

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. Only the first 
time, i.e. it will be raised once for each instance of a window.

5) A window can be closed by calling the Close() method or by clicking on the 
close button of the window manager for top-level windows.

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, but the Open event 
won't be raised again. But the Close event will be raised systematically.

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

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

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

Regards,

-- 
Benoit Minisini
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CWindow.cpp
Type: text/x-c++src
Size: 49926 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20060816/dca27055/attachment.cpp>


More information about the User mailing list