Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XtAppErrorM(3x) — HP-UX 9.05

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

XtAppError(1)

XtAppSetErrorHandler(1)

XtAppSetErrorMsgHandler(1)

XtAppSetWarningHandler(1)

XtAppSetWarningMsgHandler(1)

XtAppWarning(1)

XtAppWarningMsg(1)

XtErrorMsgHandler(2)

 

NAME

XtAppErrorMsg − call the high-level fatal error handler. 

Synopsis

void XtAppErrorMsg(app_context, name, type, class, default,  params, num_params)

    XtAppContext app_context;
    String name;
    String type;
    String class;
    String default;
    String *params;
    Cardinal *num_params;

Inputs

app_context
Specifies the application context.

nameSpecifies the general kind of error. 

typeSpecifies the detailed name of the error. 

classSpecifies the resource class of the error. 

defaultSpecifies the default message to use if no message is found in the database. 

paramsSpecifies an array of values to be inserted into the message. 

num_params
Specifies the number of elements in params. 

Returns

XtAppErrorMsg() terminates the application and does not return. 

Description

XtAppErrorMsg() passes all of its arguments except app_context to the installed high-level error handler.  The default high-level error handler is _XtDefaultErrorMsg().  It calls XtAppGetErrorDatabaseText() to lookup an error message of the specified name, type, and class in the error database.  If no such message is found, XtAppGetErrorDatabaseText() returns the specified default message.  In either case, _XtDefaultErrorMsg() does a printf-style substitution of params into the message, and passes the resulting text to the low-level error handler by calling XtError().  See XtAppGetErrorDatabaseText() for details on how messages are looked up in the error database. 

Usage

To report non-fatal error messages or warnings without exiting, use XtAppWarningMsg().  To change the high-level error handler, use XtAppSetErrorMsgHandler().  Note that the num_params argument to this function is a Cardinal *, not a Cardinal.  Although the Intrinsics interface allows separate error and warning handlers for each application context, most implementations will support only a single set of handlers.  When a new handler is installed, it will be used in all application contexts. 

Example

The following code is from the Intrinsics internal function _XtCreateWidget():

String params[2];
Cardinal num_params = 2;
 params[0] = name;
XtAppErrorMsg(XtWidgetToApplicationContext(parent),
    "nonWidget", XtNxtCreateWidget, XtCXtToolkitError,
    "attempt to add non-widget child to parent which supports only widgets",
    params, &num_params);

See Also

XtAppError(1), XtAppSetErrorHandler(1), XtAppSetErrorMsgHandler(1), XtAppSetWarningHandler(1), XtAppSetWarningMsgHandler(1), XtAppWarning(1), XtAppWarningMsg(1),
XtErrorMsgHandler(2). 

Copyright O’Reilly & Assoc.  —  X Toolkit Intrinsics Reference Manual © O’Reilly & Associates

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026