Important: The information in this document is obsolete and should not be used for new development.
Changing the Error, Warning, or Notice Posted
You can use theGXPostGraphicsError
,GXPostGraphicsWarning
, andGXPostGraphicsNotice
functions to post your own errors, warnings, and notices from inside your application.
The
- Note
- Notices are posted only in the debugging version of QuickDraw GX.
GXPostGraphicsError
function replaces the current QuickDraw GX error with any error message you provide as theerror
parameter. The error you substitute may be one of the QuickDraw GX errors or your own error message. This function stores the new error message so that subsequent calls toGXGetGraphicsError
return the error substituted by this function.Listing 3-4 shows the use of the
GXPostGraphicsError
function to change the posted error to an error having the namespecial_user_error
and the error number 2097152. This is thegxFirstAppError
constant.Listing 3-4 Changing the error posted
static long SampleCode4(void) { #define special_user_error 2097152L #define end_of_file -1L long myFilePosition = 0; /* block of application code */ if( myFilePosition == end_of_file ) { /* indicate that an error occurred */ PostGraphicsError(special_user_error); } /* block of application code */ /* You need to check for errors only once; this will catch errors generated by QuickDraw GX and any user-defined errors that were posted. */ { graphicsError myError; if( myError = GXGetGraphicsError(nil) ) return myError; } /* block of application code */ }TheGXPostGraphicsError
function is described on page 3-55. The QuickDraw GX errors are listed in the section "Errors" beginning on page 3-6.The
GXPostGraphicsWarning
function replaces the current QuickDraw GX warning with any warning message you provide as thewarning
parameter. The warning you substitute may be one of the QuickDraw GX warnings or your own warning message. This function stores the new warning message so that subsequent calls toGXGetGraphicsWarning
return the warning substituted by this function.The
GXPostGraphicsWarning
function is described on page 3-59. The QuickDraw GX warnings are listed in the section "Warnings" beginning on page 3-10.The
GXPostGraphicsNotice
function replaces the current QuickDraw GX notice with any notice message you provide as thenotice
parameter. The notice you substitute may be one of the QuickDraw GX notices or your own notice message. This function stores the new notice message so that subsequent calls toGXGetGraphicsNotice
return the notice substituted by this function.The
GXPostGraphicsNotice
function is described on page 3-65. The QuickDraw GX notices are listed in the section "Notices" beginning on page 3-27.