The File menu includes working New, Open, Close, Save, and Save As commands and the dialog boxes for locating files and disks that go with them. The File menu also includes the Print and Page Setup commands, with the corresponding code for printing multiple copies on various sizes of paper, portrait or landscape orientation, and so on. The last default command in the File menu is the Quit command, for exiting the program.
The Edit menu includes Cut, Copy, Paste, and Undo, all supported by "boilerplate" code--that is, the code that sets up and runs the commands, with stubs for the code to be provided by a specific application.
A programmer doesn't have to write any of these menu commands from scratch. They're working and ready to use, although in some cases they can't really do much without additional application-specific code. To make an application do anything useful, it's necessary to override at least some of the application framework's member functions.
For example, if you're writing a drawing application using MacApp, you need to
add only the additional parts that give the application its drawing capabilities;
you can use everything else as is. You would add a Tools menu for the graphic
objects your program can draw and pieces of code that determine what each tool in
that menu does when the user chooses the tool and moves or clicks the mouse
within a window. You would also override MacApp's boilerplate code for the data
your program reads and writes when the user opens, closes, and saves files,
replacing it with code that can read and write the actual data for the graphics
objects your program knows about. By just subclassing and overriding these few
parts of the MacApp framework, you can create a complete, well-behaved drawing
application with much less effort than it would take to create it without the
framework.
[Contents]
[Previous]
[Next]