http://www.newton-inc.com/dev/techinfo/qa/qa.htm
AddEntryFromStationery
. For instance: if GetRoot().NewtWorks then
GetRoot().NewtWorks:AddEntryFromStationery(stationerySym);
AdoptEntryFromStationery
. To create a new entry, you must add the basic Newton Works soup entry slots and then any stationery-specific slots:class
: Class of the item. For instance, for Draw documents, use the symbol 'drawPaper
version
: Integer, the current version of the entrytitle
: String which is the document titletimeStamp
: Creation date of the entryrealModTime
: Date the entry was most recently modifiedsaveData
: a frame with the following slots:shapes
: Required. An array of a single item, a picture as returned by the global function MakePict
. selection: [], // the empty array
styles: nil,
saveData
slot of Draw documents already in Newton Works should be treated as read-only. (Do not try to modify these data structures in any way.)SaveData
: the object returned from protoTXView:Externalize().
See the Newton 2.1 OS documentation for information about Externalize().
Note that this data must be from a protoTXView
that uses VBOs (it uses the protoTXView:SetStore(...)
method), or Newton Works can run out of NewtonScript memory when editing the document.hiliteRange
: frame with the document's hilite range (see the protoTXView
documentation for details)margins
: a frame with slots 'top
, 'left
, 'bottom
, 'right
, which are the document's margins in pixels. The frame can also optionally have the slots 'userTop
, 'userLeft
, 'userBottom
, and 'userRight
that will contain numbers (integer or real) with the margin sizes translated to user units (inches or centimeters.) If the userXXX
slots are missing or nil
, they will be calculated from the pixel values. if GetRoot().NewtWorks then
GetRoot().NewtWorks:AdoptEntryFromStationery(theEntry, stationerySym, GetDefaultStore());
See the Newton Programmer's Reference for more info about the NewtApplication:AdoptEntryFromStationery(...)
method.