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: QuickDraw GX Environment and Utilities /
Chapter 3 - Errors, Warnings, and Notices / Errors, Warnings, and Notices Reference
Functions / Warning Posting and Handling


You can use the GXSetUserGraphicsWarning function to install an application-defined warning handler.

void GXSetUserGraphicsWarning(gxUserWarningFunction userFunction, 
                            long reference);

The application's warning function that is to be passed the warning code.
A long value that gets called each time a warning occurs. This value can be used by the application for any purpose.
The GXSetUserGraphicsWarning function installs an application-defined warning handler. This function installs a function pointer that is called whenever a warning is posted. Setting the userFunction parameter to nil removes the error function.

The userFunction parameter points to an application-defined warning handler defined by the following type:

typedef void (*gxUserWarningProcPtr)(gxGraphicsWarning status,
               long refcon)
typedef gxUserWarningProcPtr gxUserWarningFunction;
The second parameter is the long reference parameter. Whenever a warning is posted by the application, the installed warning handler is called with the warning number. The reference number is passed to the GXSetUserGraphicsError function.

You can install a warning handler before calling the GXEnterGraphics function , but you should call the GXNewGraphicsClient function first. If you don't, GXNewGraphicsClient will be called for you.

The use of this function is described in the section "Installing an Error, Warning, or Notice Handler" beginning on page 3-38.

The GXGetUserGraphicsWarning function described in the next section is used to return a pointer to the application-defined warning handler.

An alternative method of posting warnings is to use the QuickDraw GX warning messages. This topic is discussed in the section "Obtaining Errors, Warnings, and Notices" beginning on page 3-30.

The GXGetGraphicsError function described on page 3-54 is used to obtain the first and last QuickDraw GX errors posted.

The application-defined warning handler is described on page 3-71.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996