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: <function, 0 arg(s) #46938D>,
StringExtract: <function, 2 arg(s) #4693AD>,
textScript: <function, 2 arg(s) #4693CD>},
{_proto: {@451},
symbol: calllog,
name: "Calls",
superSymbol: callapp,
description: "Phone Message",
icon: {@718},
version: 1,
metadata: NIL,
taskSlip: |PhoneHome:Newton|,
MakeNewEntry: <function, 0 arg(s) #47F9A9>,
StringExtract: <function, 2 arg(s) #47F969>,
textScript: <function, 2 arg(s) #47F989>},
...]
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.
© 2007-1970, o7 studio » при воспроизведении материала сайта ссылка обязательна