C H A P T E R 3
slots are read and the child views
are instantiated using this same process. As part of the process, the following
messages are sent to each child view, in this order:
message is sent to the view.
7. The view is displayed if its
bit is set.
message is sent to the view and then the
message is sent to the view. (Note that the
message is not sent to any child views, however.)
9. Each of the child views is drawn, in hierarchical order, and the
message is sent to each of these views, immediately
after it is drawn.
As you can see from step 5, when a view is opened, all child views in the hierarchy
under it are also shown (as long as they are flagged as visible). A nonvisible child
view can be subsequently shown by sending it the
message--as long as it
has been declared.
Closing a View
When you send a view the
message, the graphic representation of the view
(and of all of its child views) is destroyed, but the view memory object is not
necessarily destroyed. There are two possibilities:
If the view was declared, and the view in which it was declared is still open, the
frame is preserved. You can send the view another
reopen it at a later time.
A view memory object is finally destroyed when the view in which it was
declared is closed. That is, when a view is closed, all views declared in it are
made available for garbage collection.
If the view being closed was not declared, both its graphic representation and its
view memory object are made available for garbage collection when it is closed.
When a view is closed, the following steps occur:
1. If the view is closing because it was directly sent the
message, the system sends it the
message. (If the view
is closing because it is a child of a view being closed directly, the
message is not sent to it.)
2. The graphic representation of the view is removed from the screen.
3. The view is sent the
The view itself may or may not be marked for garbage collection, depending on
whether or not it was declared.