O'Reilly logo

REALBasic: TDG, 2nd Edition by Matt Neuburg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Events

You may wish to review Section 7.3, to get a feel for how window events fit into the lifetime of your application.

The following events are received by a window instance in connection with its lifetime:

Open

Sent to a window instance after it comes into existence, after an Open event has been sent to each control in the window, but before the window becomes visible to the user.

CancelClose

Sent to a window instance because the process of closing it has been initiated; for how this happens, see Section 9.2, earlier in this chapter. The CancelClose event handler can perform last-minute activities; it can also prevent the window from closing by returning true. (If the application was trying to quit, this will also prevent it from doing so; see Chapter 7.) If it returns false or nothing at all, the closing of the window will proceed. Thus, for example, the CancelClose event handler is the place for a document window to put up its Save Changes dialog, giving the user a chance to save or to prevent the window from closing.

Close

Sent to a window instance just before it is destroyed. The window has returned false (or nothing) from the CancelClose event. Each control in the window has received a Close event. There is nothing now that the window can do to prevent itself from being destroyed.

The following events are received by a window instance in connection with physical alterations:

Activate

Sent to a window instance because the window has come to the front: it has been visibly instantiated, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required