Name
set_values_almost — Core method to negotiate compromise geometries.
Synopsis
typedef void (∗XtAlmostProc)(Widget, Widget, XtWidgetGeometry ∗, XtWidgetGeometry ∗);
Widget old;
Widget new;
XtWidgetGeometry ∗request;
XtWidgetGeometry ∗reply;
Arguments
oldSpecifies a copy of the object as it was before the XtSetValues call.
newSpecifies the object instance record.
requestSpecifies the original geometry request that was sent to the geometry manager that returned XtGeometryAlmost.
replySpecifies the compromise geometry that was returned by the geometry manager that returned XtGeometryAlmost.
Description
The purpose of the set_values_almost method is to negotiate a compromise geometry with the parent.
A widget’s set_values_almost method is called when a client tries to set a widget’s geometry by means of a call to XtSetValues and the geometry manager cannot satisfy the request but instead returns XtGeometryAlmost and a compromise geometry. The set_values_almost method takes the original geometry and the compromise geometry and determines whether the compromise is acceptable or a different compromise might work. It returns its results in the new parameter, which is then sent back to the geometry manager for another try.
Most classes inherit the set_values_almost method from their superclass by specifying XtInheritSetValuesAlmost in the class initialization. The Core set_values_ almost method always accepts the compromise suggested.
See Chapter 11, Geometry Management, in Volume Four, X Toolkit Intrinsics Programming Manual.
Structures
The XtWidgetGeometry structure is similar, but not identical, to the corresponding Xlib structure:
typedef unsigned long XtGeometryMask;
typedef struct {
XtGeometryMask request_mode;
Position x, y;
Dimension width, height;
Dimension border_width;
Widget sibling;
int stack_mode;
} XtWidgetGeometry;
The request_mode definitions are from <X11/X.h>:
#defineCWX(1<<0)
#defineCWY(1<<1)
#defineCWWidth(1<<2)
#defineCWHeight(1<<3)
#defineCWBorderWidth(1<<4)
#defineCWSibling(1<<5)
#defineCWStackMode(1<<6)
The Xt Intrinsics also support the following value:
#defineXtCWQueryOnly(1<<7)
XtCWQueryOnly indicates that the corresponding geometry request is only a query as to what would happen if this geometry request were made and that no widgets should actually be changed.
XtMakeGeometryRequest, like the Xlib XConfigureWindow function, uses request_mode to determine which fields in the XtWidgetGeometry structure you want to specify.
The stack_mode definitions are from <X11/X.h>:
#defineAbove0
#defineBelow1
#defineTopIf2
#defineBottomIf3
#defineOpposite4
The Intrinsics also support the following value:
#defineXtSMDontChange5
For precise definitions of Above, Below, TopIf, BottomIf, and Opposite, see the reference page for ConfigureWindow in Volume Two, Xlib Reference Manual. XtSMDontChange indicates that the widget wants its current stacking order preserved.
See Also
Core(3),
set_values(4), Constraint set_values(4).