Name
XtResourceDefaultProc — prototype procedure passed as a resource converter when XtRCallProc is specified in a resource list entry.
Synopsis
typedef void (∗XtResourceDefaultProc)(Widget, int, XrmValue ∗)
Widget w;
int offset;
XrmValue ∗value;
Arguments
wSpecifies the widget whose resource is to be obtained.
offsetSpecifies the offset of the field in the widget record.
valueSpecifies the resource value to fill in.
Description
Every resource has a representation type. There are 26 types defined by the Intrinsics, and additional user types can be created by registering a type converter for them (see XtSetTypeConverter).
Two special representation types (XtRImmediate and XtRCallProc) are usable only as default resource types. XtRImmediate indicates that the value in the default_addr field of the XtResource structure is the actual value of the resource rather than the address of the value. The value must be in correct representation type for the resource. XtRCallProc indicates that the value in the default_addr field of the XtResource structure is a pointer to a procedure. This procedure is automatically invoked with the widget, resource_offset, and a pointer to the XrmValue in which to store the result and is an XtResourceDefaultProc.
The XtResourceDefaultProc procedure should fill in the addr field of its value argument with a pointer to the default data in its correct type.
The example below shows an XtResourceDefaultProc used to obtain a pointer to the current screen at runtime.
/∗ARGSUSED∗/
void XtCopyScreen(widget, offset, value)
Widget widget;
int offset;
XrmValue ∗value;
{
value->addr = (caddr_t)(&widget->core.screen);
}
See Also
XtGetApplicationResources(1), XtGetConstraintResourceList(1), XtGetResourceList(1).