Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Programmer's Guide to MacApp / Part 1 - MacApp Theory and Architecture
Chapter 4 - Launching and Terminating an Application


Calling Run to Put MacApp in Control

After your main routine initializes MacApp and creates and initializes an application object, it makes the following call:

   aYourApplication->Run();
The TApplication::Run method checks that there is enough memory to run the application, calls the application object's DoLaunchClipboard method, and finally calls MainEventLoop, which starts the application running, looking for incoming events to dispatch.

Launching the Clipboard

The InitUClipboardMgr routine (called previously from DoInitUMacApp) instantiates a global Clipboard manager object, gClipBoardMgr. The application object's DoLaunchClipboard method now performs additional setup for MacApp's Clipboard support.

DoLaunchClipboard calls the gClipBoardMgr object's Launch method. The Launch method makes sure there is a Clipboard window, then adds the gClipBoardMgr object to the application object's behavior list so it can respond to events that might affect Clipboard operations.

The Launch method then checks the desk scrap for information and calls the application object's MakeViewForAlienClipboard method. Your application object can override MakeViewForAlienClipboard to look for your private data types on the desk scrap and display any data it finds. MacApp's default Clipboard support automatically displays 'PICT' and 'TEXT' data.

For more information, see "The Clipboard," beginning on page 129.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
25 JUL 1996