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 6 - Dialog Manager


Using the Dialog Manager

You can use the Dialog Manager to

With Dialog Manager routines, you invoke alert boxes or create dialog boxes in windows whose contents are, in turn, managed by the Dialog Manager. The Dialog Manager automatically handles update events, activate events, cursor tracking, and most text-editing tasks for your alert and dialog boxes.

To implement alerts and dialog boxes, you generally

These tasks are explained in greater detail in the rest of this chapter.

Before using the Dialog Manager, you must initialize QuickDraw, the Font Manager, the Window Manager, the Menu Manager, and TextEdit, in that order. Then initialize the Dialog Manager by using the InitDialogs procedure.

The Dialog Manager uses the system alert sound for signaling the user during various alert stages. If you want to use alert sounds other than the system alert sound, write
your own sound procedure (as illustrated in Listing 6-3 on page 6-21) and call the ErrorSound procedure to make it the current sound procedure.

If you want to display static text or editable text in a font other than the system font, you can use the SetDialogFont procedure. However, there are a number of caveats regarding this procedure. For descriptions of these caveats, see "Special Considerations" in the description of SetDialogFont on page 6-105.

System 7 and earlier versions of the Communications Toolbox add several new routines (namely, AppendDITL, ShortenDITL, and CountDITL) that make it easier for you
to add items to, remove items from, and count the number of items in a dialog box. Before calling these routines, you should make sure that they are available by using the Gestalt function with the gestaltDITLExtAttr selector. Test the bit field indicated by the gestaltDITLExtPresent constant in the response parameter. If the bit is set,
then AppendDITL, ShortenDITL, and CountDITL are available.

CONST gestaltDITLExtPresent= 0;  {if this bit is set, then }
                                 { AppendDITL, ShortenDITL, }
                                 { & CountDITL are available}
The Gestalt function is described in the chapter "Gestalt Manager" of Inside Macintosh: Operating System Utilities.


Subtopics
Creating Alert Sounds and Alert Boxes
Creating Dialog Boxes
Providing Items for Alert and Dialog Boxes
Manipulating Items
Using an Application-Defined Item to Draw the Bold Outline for a Default Button
Displaying Alert and Dialog Boxes
Handling Events in Alert and Dialog Boxes

Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996