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, andGXPostGraphicsNoticefunctions 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.
![]()
GXPostGraphicsErrorfunction replaces the current QuickDraw GX error with any error message you provide as theerrorparameter. 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 toGXGetGraphicsErrorreturn the error substituted by this function.Listing 3-4 shows the use of the
GXPostGraphicsErrorfunction to change the posted error to an error having the namespecial_user_errorand the error number 2097152. This is thegxFirstAppErrorconstant.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 */ }TheGXPostGraphicsErrorfunction is described on page 3-55. The QuickDraw GX errors are listed in the section "Errors" beginning on page 3-6.The
GXPostGraphicsWarningfunction replaces the current QuickDraw GX warning with any warning message you provide as thewarningparameter. 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 toGXGetGraphicsWarningreturn the warning substituted by this function.The
GXPostGraphicsWarningfunction is described on page 3-59. The QuickDraw GX warnings are listed in the section "Warnings" beginning on page 3-10.The
GXPostGraphicsNoticefunction replaces the current QuickDraw GX notice with any notice message you provide as thenoticeparameter. 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 toGXGetGraphicsNoticereturn the notice substituted by this function.The
GXPostGraphicsNoticefunction is described on page 3-65. The QuickDraw GX notices are listed in the section "Notices" beginning on page 3-27.