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 / Dialog Manager Reference
Dialog Manager Routines / Creating Alerts


CautionAlert

To display an alert box with a caution icon in its upper-left corner (or, if appropriate for the alert stage, to play an alert sound instead of or in addition to displaying the alert box), use the CautionAlert function.

FUNCTION CautionAlert (alertID: Integer;
                       filterProc: ModalFilterProcPtr): Integer;
alertID
The resource ID of an alert resource. If the alert resource is missing, the Dialog Manager returns to your application without creating the requested alert.
filterProc
A pointer to a function that responds to events not handled by the ModalDialog procedure. If you set this parameter to NIL, the
Dialog Manager uses the standard event filter function, which allows users to press the Return or Enter key in lieu of clicking the default button. However, your application should provide a simple event filter function that also allows background applications to receive update events. Pass a pointer to the event filter function in this parameter.
DESCRIPTION
The CautionAlert function is the same as the Alert function except that, before drawing the items in the alert box, CautionAlert draws the caution icon in the upper-left corner (within the rectangle with local coordinates [10,20,42,52]). The caution icon has the following resource ID:

CONST cautionIcon = 2;  {caution icon}
By default, the Dialog Manager uses the standard caution icon from the System file.
You can change this icon by providing your own 'ICON' resource with this resource
ID number.

Use a caution alert to alert the user of an operation that may have undesirable results if it's allowed to continue. Give the user the choice of continuing the action (by clicking an OK button) or stopping it (by clicking a Cancel button).

SEE ALSO
Figure 6-4 on page 6-9 illustrates the caution icon in a typical caution alert. Except
that it includes a caution icon in the alert box, CautionAlert is identical to the
Alert function. See the description of the Alert function on page 6-99 for detailed information about the parameters and behavior of both of these functions.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996