Name
get_values_hook — Core method for getting subpart resource values.
Synopsis
typedef void (∗XtArgsProc)(Widget, ArgList, Cardinal ∗);
Widget w;
ArgList args;
Cardinal ∗num_args;
Arguments
wSpecifies the widget whose subpart resource values are to be retrieved.
argsSpecifies the argument list that was passed to XtSetValues.
num_argsSpecifies the number of arguments in the argument list.
Description
Widgets can return resource values from subparts when the application calls XtGetValues by supplying a get_values_hook method.
The get_values_hook method should call XtGetSubvalues and pass the appropriate resource list.
The hook methods are called with different arguments than their nonhook counterparts. They are passed a single copy of the widget instance structure (the new copy already modified in the nonhook methods), and the argument list passed to the Xt routine that triggered the method. The set_values_hook and get_values_hook methods simply take this widget ID and argument list and pass them to XtSetSubvalues or XtGetSubvalues, respectively.
The get_values_hook methods are called in superclass-to-subclass order after all the resource values have been fetched by XtGetValues.
As of Release 4, the initialize_hook and set_values_hook methods are still called for backwards compatibility but are obsolete because the same information (the argument lists) has been added as arguments to the initialize and set_values methods. However, get_values_hook is still necessary.
Examples
The example below shows the get_values_hook method for the AsciiSrc subpart of the R3 Text widget (somewhat simplified to show only the essential elements).
static void
GetValuesHook(src, args, num_args)
XawTextSource src;
ArgList args;
Cardinal ∗ num_args;
{
.
.
.
XtGetSubvalues((caddr_t) src,
sourceResources,
XtNumber(sourceResources),
args,
∗num_args);
}
See Also
XtCreateWidget(1), XtGetSubvalues(1), XtGetValues(1),
Core(3).