how to intercept close in a SystemWindow
Boris Gaertner
Boris.Gaertner at gmx.net
Sun Nov 30 11:00:19 UTC 2003
From: Martin Kuball <MartinKuball at web.de> asked:
Subject: how to intercept close in a SystemWindow
> Hi!
>
> I'm building a small apllication which has some controls in a System
window
> and which may open some other morphs. I would like to delete these other
> morphs when I close the SystemWindow. How can I do this?
>
It may help to look at
Object>>windowIsClosing. This is a do-nothing method that subclasses may
redefine. When you browse the implementors, you see than the Debugger,
Celeste, the ArchiveViewer and the ProcessBrowser use this method to
do some cleanup. Perhaps your model should do something similar.
Note that the method is for cleanup: The window
will be closed anyway and #windowIsClosing is not the right place
to say"no". To say no, the model is required to implement the
method #okToChange, which is required to reutrn a boolean.
Look also into SystemWindwo>>delete to see that
windowIsClosing is sent after okToChange.
Hope this helps,
Boris
More information about the Squeak-dev
mailing list
|