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: Macintosh Toolbox Essentials /
Chapter 4 - Window Manager / Introduction to Windows


Dialog Boxes and Alert Boxes

Macintosh applications use alert boxes and dialog boxes to give the user messages and
to solicit information. A text-processing application, for example, might display an
alert box telling the user that a newly inserted graphic does not fit within the page boundaries. It might display a dialog box in which the user can specify margins, tabs, and other formatting information. (The chapter "Dialog Manager" in this book explains how to use the various kinds of alert boxes and dialog boxes.)

Alert boxes and dialog boxes are merely special-purpose windows. You can handle all alert boxes and most modal dialog boxes through the Dialog Manager, which itself calls the Window Manager. You supply the Dialog Manager with lists of the items in your alert boxes and dialog boxes, and the Dialog Manager displays the windows, tells you which items the user is manipulating, and disposes of the windows when the user is done. Your application provides the code that responds to the user's selections in the alert and dialog boxes.

Although you can specify any window type for your alert boxes and modal dialog boxes, the Dialog Manager functions that handle alert boxes and modal dialog boxes do not support window manipulation. You should therefore use one of the window types without a title bar or size box, most typically the dBoxProc window type, for alert boxes and modal dialog boxes. (When the user is responding to a modal dialog box, mouse-down events outside the menu bar or the content region of the dialog box result only in the sounding of the system alert. Note that the Process Manager does not perform major switching while the ModalDialog procedure is handling events.)

You use the movableDBox window type for movable modal dialog boxes. As described in the chapter "Dialog Manager" in this book, your application can use the Dialog Manager to help handle events in a movable modal dialog box. Your application, however, must handle window-manipulation events--ordinarily only the moving of the movable modal dialog box window.

Use the noGrowDocProc window type for modeless dialog boxes. You typically use
the Dialog Manager to handle events in a modeless dialog box, much like events in
a movable modal dialog box. Your application handles window-manipulation events in modeless dialog boxes just as it handles them in document windows.

If you use complex dialog boxes, you might find it's more efficient to use the Window Manager and other parts of the Toolbox, instead of the Dialog Manager, to create and manage your own dialog box windows. Again, see the chapter "Dialog Manager" in this book for a list of characteristics to consider when evaluating the complexity of a dialog box and for examples of customized dialog boxes.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996