C H A P T E R 4
NewtApp Applications
About the NewtApp Framework
4-3
The parts of the NewtApp framework are designed to fit together using the
two-part NewtonScript inheritance scheme. Generally speaking, the framework is
constructed so the user interface components of your application (such as views
and buttons) use proto inheritance to make methods and application-state variables,
which are provided by NewtApp (and transparent to you), available to your
application. Parent inheritance implements slots that keep track of system details.
Because the NewtApp framework structure is dependent on both the parent and
proto structure of your application, it requires applications to be constructed in a
fairly predictable way. Children of certain NewtApp framework protos are required
to be particular protos; for example, the application base view must be a
newtApplication
proto.
W A R N I N G
When you override system service methods and functions be
careful to use the conditional message send operator (
:?
) to avoid
inadvertently overriding built-in functionality; otherwise, your
code will break.
There may also be alternate ways to construct a NewtApp
application, other than those recommended in this chapter and in
Chapter 5, "Stationery." Be forewarned that applications using
alternate construction methods are not guaranteed to work in
the future.
Figure 4-1 shows the four conceptual layers of NewtApp protos that you use to
construct an application: the application base view, the layout view, the entry view,
and the slot views.
Figure 4-1
The main protos in a NewtApp-based application
_proto: newtStatusBar
_proto: newtApplication
title: "MyApp",
_proto: newtLayout
_proto: newtEntryView
_proto: newtLabelInputLine
path: 'name.first,
label: "First",
_proto: newtLabelInputLine
path: 'name.last,
label: "Last",
Layout View
Base View
Entry View
Slot View
_proto: newtClockShowBar