Important: The information in this document is obsolete and should not be used for new development.
MacApp Sample Applications
MacApp is distributed with a number of sample applications that demonstrate how to use the MacApp class library. You can build the sample applications to see what a feature looks like in a running application, then examine the code to see how the feature was implemented. The type of application you build depends on the type of computer your application will run on.Types of Macintosh Computers
Macintosh computers currently are of two types:
If an application is built with 68K code, it is said to run native on a 68K machine. The application will also run on a Power Macintosh computer, but only in emulation mode--the Power Macintosh computer executes 68K processor instructions in software.
- The 68K-based machines include all Macintosh computers whose main processor is a Motorola 68000, 68020, 68030, or 68040.
- The Power Macintosh machines include all Macintosh computers whose main processor is some version of the PowerPCTM processor.
An application built with PowerPC code will run native on a Power Macintosh computer but will not run at all on a 68K-based machine. But a native Power Macintosh application will run much faster on a Power Macintosh computer than will the 68K version of the same application.
A third type of application, called a fat application, has 68K code in its resource fork and Power Macintosh code in its data fork. It takes up more room on disk than either of its skinnier cousins, but it can run native on either machine.
With MacApp, you can build any type of application, both for your own applications and for the sample applications distributed with MacApp. Appendix A explains how to build different types of applications in the MPW environment.
The Simplest MacApp Application
The simplest MacApp application, called the Nothing application, contains only one code file, with less than 150 lines of code. Yet when linked with MacApp, Nothing can do all of the following:
- display standard menus
- respond to user menu choices
- create documents (limited only by available memory)
- display document data in a standard Macintosh window
- show an About box
- show a Clipboard window containing text or pictures
Other Sample Applications
MacApp includes these additional sample applications:
- Skeleton. The Skeleton sample provides a basic application structure for your application to build on. It shows how to define subclasses of important MacApp classes and how to perform basic operations with MacApp, such as handling menus, reading and writing documents, opening windows, and using commands to track the mouse.
- IconEdit. This icon-editing application demonstrates MacApp's scripting support, including recordable commands and a scripting interface to get and set object properties.
- DemoDialogs. The DemoDialogs application creates a wide variety of windows and dialogs, including modal and nonmodal dialog boxes, floating windows, custom controls, and data entry windows with tabbing between text entry fields. It also demonstrates MacApp's support for dragging and dropping data.
- DemoText. The DemoText application demonstrates a number of text-editing features, including reading and writing text documents, text entry with undo, drag and drop of text, displaying page breaks, and printing. It also demonstrates MacApp's support for PowerTalk mailers (electronic mailers that can be added to any document). The DemoText application includes support for scripting, including a Script menu for executing scripts from a script folder.
- Calc. The Calc program implements a spreadsheet-like application, with operations on rows and columns of cells. The spreadsheet supports publish and subscribe for cell data.