
Introduction to Protos
protoTextButton is a much larger structure, the template remains small (see FIGURE 7.3).

FIGURE 7.3 : The relationship between a template and its proto.
In C++, an object that inherits from another object gains not only functionality, but size. In C++, a 4 byte object inheriting from a 100 byte object ends up 104 bytes big. So in NewtonScript, how big would a 4 byte object protoing from a similar 100 byte object be? The answer is 8 bytes (four belong to the original template and another four to store the _proto pointer). The speed versus size trade-off was made in favor of size.
An online version of Programming for the Newton using Macintosh, 2nd ed. ©1996, 1994, Julie McKeehan and Neil Rhodes.
Last modified: 1 DEC 1996