Manual Reference Pages - XMTASSERTWIDGETCLASS (3)
XmtAssertWidgetClass() - verify the type of a widget.
void XmtAssertWidgetClass(Widget w,
The widget to be checked.
The desired widget class.
An identifying string to be used in the error
message displayed if the widget w is not of class c or
a subclass of it. This argument is most useful
when it is the name of the procedure that calls
XmtAssertWidgetClass() calls XtIsSubclass() to verify that
widget w is of class c or is a subclass of c. If so, it
returns and takes no action. If w is not of class c or a
subclass, then XmtAssertWidgetClass() prints an error message
and calls the function abort() which will cause the application to dump core and exit.
XmtAssertWidgetClass() is an analog to assert(). It is used
mainly by widget writers, but also occasionally by application programmers who are writing a function that expects a
widget argument of a specific type. Many of the functions in
the Xmt library call this function internally.
XmtAssertWidgetClass() is useful during the process of
application development and debugging because it gives a very
clear signal (a message and a core dump with its associated
stack trace) of when application code is calling a function
with a bad widget argument. Once an application is debugged,
you can compile your code (and the Xmt library) with the
-DNDEBUG flag, which will cause any calls to XmtAssertWidgetClass() to be removed by the C preprocessor.
Chapter 8, Utility Functions,
abort(), assert(), XtIsSubclass().
|Xmt ||XMTASSERTWIDGETCLASS (3) ||Motif Tools |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.