beautypg.com

Using the names application 19 – Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 678

background image

C H A P T E R 1 9

Built-in Applications and System Data

19-4

Names

Using the Names Application

19

This section describes

adding a new type of card to the Names application

adding a new data item to a card

adding a new card layout style

using the Names methods

using the Names soup

using two protos with pickers for personae and emporia

Adding a New Type of Card

19

The New button on the Names status bar creates its picker by looking at the
registered dataDefs for the Names application. All dataDefs whose

superSymbol

slot is set to

'Names

show up in the New picker. When the user picks a choice, the

MakeNewEntry

routine defined for that dataDef is called.

Built-in choices on the New picker include Person, Company, and Group. You
can create a new type of card for the Names application by supplying a new
data definition.

In addition to the usual slots found in a dataDef frame, Names dataDefs contain
two special slots,

overviewIcon

and

viewsToDisplay

.

These slots are described in “Names Data Definition Frame” (page 16-2) in Newton
Programmer’s Reference
. For information on dataDefs in particular, and stationery
in general, see Chapter 5, “Stationery.”

Adding a New Data Item

19

The Add button on the Names status bar allows the user to add new items of
information to a card, such as a phone number or an address for a person. There is
a Custom choice on the Add picker (pop-up menu), through which the user can
create special data items that contain a simple text field. However, you can
programmatically add new choices to the picker by creating and registering new
view definitions with the Names application.

The Add button creates its picker from the viewDefs registered for the card type of
the current card. Of these, only viewDefs whose

type

slot is set to

'editor

show

up in the Add picker.

Names viewDefs must contain a special slot called

infoFrame

, in addition to

those slots required of all viewDefs. The

infoFrame

slot is described in “Names

View Definition Frame” (page 16-3), and the slots common to all viewDefs are
described in “viewDef Frame” (page 4-1) in Newton Programmer’s Reference.