Bookstore Inventory

Replace Steps 18, 19, 20

Instead of steps 18, 19, and 20 (see page 303), use the following protos. We need one slot proto for each slot in the soup entry:

1. Draw a newtLabelInputLine as a child of the newtEntryView. Set the following slots:

path
'author

label
"Author"

2. Draw a newtLabelInputLine as a child of the newtEntryView. Set the following slots:

path
'title

label
"Title"

3. Draw a newtLabelDateInputLine as a child of the newtEntryView. Set the following slots:

path
'acquireDate

label
"Acquired"

flavor
// use short rather than long
// format for date
{
_proto: newtDateFilter,
shortFormat: kFormatDefault,
longFormat: nil,
}

4. Draw a newtLabelNumInputLine as a child of the newtEntryView. Set the following slots:

path
'numberInStock

label
"# in stock"

flavor
// make sure numberInStock is
// stored as integer rather than
// as a real number
newtIntegerFilter

5. Draw a newtLabelNumInputLine as a child of the newtEntryView. Set the following slots:

path
'price

label
"$"

flavor
// make sure price is displayed
// with two digits after decimal
// place
{
_proto: newtNumberFilter,
format:
"%0.2f",
}

FIGURE 10.12 shows what the application looks like once it is complete up to this point.

FIGURE 10.12 : Bookstore application as a minimal NewtApp.


An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.

Last modified: 1 DEC 1996