Name
Constraint set_values — Constraint method for processing constraint resource changes.
Synopsis
typedef Boolean (∗XtSetValuesFunc)(Widget, Widget, Widget, ArgList, Cardinal ∗);
Widget current;
Widget request;
Widget new;
ArgList args;
Cardinal ∗num-args;
Arguments
currentSpecifies a copy of the widget as it was before the XtSetValues call.
requestSpecifies a copy of the widget with all values changed as asked for by the XtSetValues call before any class set_values procedures have been called.
newSpecifies the widget with the new values that are actually allowed.
argsSpecifies the argument list passed to XtSetValues.
num_argsSpecifies the count of arguments in the argument list.
Description
The Constraint set_values method is called when the constraint resources of its children are called. It is checking the validity of these new settings, and triggering a new layout based on the new settings.
The Constraint set_values method operates in the context of the child. This means its widget arguments are instances of the child, not the parent, even though the method itself is part of the parent’s code.
The current, request, and new arguments are widget instance records of the appropriate widget class. new reflects values that have been modified by superclass set_values methods. request reflects changes made only by the XtSetValues call itself. current was the widget instance at the time of the call, reflecting no changes. A widget can refer to request, to resolve conflicts between current and new. Any changes that the widget needs to make should be made to new.
Before calling the Constraint set_values method, the Intrinsics modify the resources of the request widget according to the contents of the ArgList; if the widget names all of its resources in the class resource list, the contents of args never need examining.
An XtSetValuesFunc returns a Boolean value of True if the widget should be redisplayed and a value of False otherwise. Constraint set_values methods should not do any work in response to anticipated changes in geometry because XtSetValues will eventually perform a geometry request. The request might be denied. If the widget actually changes size in response to an XtSetValues, its resize method is called. Widgets should make geometry-related changes there.
An XtSetValuesFunc cannot assume that the widget is realized, since it is permissible for an application to call XtSetValues before a widget is realized.
Examples
The following is the Constraint set_values method of the Athena Form widget class:
/∗ ARGSUSED ∗/
static Boolean ConstraintSetValues(current, request, new)
Widget current, request, new;
{
return( FALSE );
}
See Also
XtSetValues(1),
Constraint(3), Core(3),
set_values(4), set_values_hook(4).