beautypg.com

Apple Newton Programmer’s Newton 2.0 (for Newton 2.0) User Manual

Page 190

background image

C H A P T E R 5

Stationery

5-8

Using Stationery

A call to the global function

GetDefs

in the NTK Inspector window returns a

series of frames describing dataDefs that have been registered with the system. An
excerpt of the output from a call made in the Inspector window follows.

GetDefs('dataDef,nil,nil)

#44150A9 [{_proto: {@451},

symbol: paperroll,

name: "Note",

superSymbol: notes,

description: "Note",

icon: {@717},

version: 1,

metadata: NIL,

MakeNewEntry: ,

StringExtract: ,

textScript: },

{_proto: {@451},

symbol: calllog,

name: "Calls",

superSymbol: callapp,

description: "Phone Message",

icon: {@718},

version: 1,

metadata: NIL,

taskSlip: |PhoneHome:Newton|,

MakeNewEntry: ,

StringExtract: ,

textScript: },

...]

GetDefs

and other stationery functions are documented in Newton Programmer’s

Reference.

Creating a DataDef

5

You create a dataDef by basing it on a

newtStationery

proto. In NTK it is

created as a layout file, even though it is never displayed. The following steps lead
you through the creation of the dataDef that is used to extend the built-in Notes
application.

Note again that the data definition is adopted into an application’s soup only when
the application and dataDef have matching values in their

superSymbol

slots.

For instance, when you are building a dataDef as an extension to the Notes
application, as we are in this example, your dataDef must have

'notes

as the

value of its

superSymbol

slot.