C H A P T E R 3
Remember that the
contain templates, not views. If you try to send a message like
to one of the objects listed in this array, the system will
probably throw an exception because it is not a view.
During run time, if you want to obtain references to the child
views of a particular view, you must use the
method. This method returns views from both the
slots. This method is
described in "Getting References to Views" (page 3-32).
As your application executes, it receives messages from the system that you can
choose to handle by providing methods that are named after the messages. These
messages give you a chance to perform your own processing as particular events
For example, with views, the system performs default initialization operations
when a view is instantiated. It also sends a view a
message. If you provide a method to handle this message, you can perform your
own initialization operations in the method. However, handling system messages in
your application is optional.
The system usually performs its own actions to handle each event for which it
sends your view messages. Your system message-handling methods do not override
these system actions. You cannot change, delete, or substitute for the default system
event-handling actions. Your system message-handling methods augment the
For example, when the view system receives a Show command for a view, it
displays the view. It also sends the view the
message. If you
have provided a
method, you can perform any special
processing that you need to do when the view is displayed.
The system sends messages to your application at specific times during its handling
of an event. Some messages are sent before the system does anything to respond to
the event, and some are sent after the system has already performed its actions. The
timing is explained in each of the message descriptions in "ApplicationDefined
Methods" (page 2-65) in the Newton Programmer's Reference.
View instantiation refers to the act of creating a view from its template. The process
of view instantiation includes several steps and it is important to understand when
and in what order the steps occur.