Name
XtMakeGeometryRequest — request parent to change child’s geometry.
Synopsis
XtGeometryResult XtMakeGeometryRequest(w, request, reply_return)
Widget w;
XtWidgetGeometry ∗request;
XtWidgetGeometry ∗reply_return;
Arguments
wSpecifies the child widget that is making the request.
requestSpecifies the desired widget geometry (size, position, border width, and stacking order).
reply_return
Returns the allowed widget size or may be NULL if the requesting widget is not interested in handling XtGeometryAlmost.
Description
Child widgets are not allowed to change their own size or position. Instead, a child uses XtMakeGeometryRequest to ask its parent to change its geometry. XtMakeGeometryRequest returns XtGeometryYes, XtGeometryNo, or XtGeometryAlmost. (See below.)
XtMakeGeometryRequest performs the following tasks:
•If the widget is unmanaged or the widget’s parent is not realized, it makes the changes to the widget’s preferred geometry and returns XtGeometryYes.
•If the parent is not a subclass of compositeWidgetClass or the parent’s geometry_manager method (the function pointed to by the geometry_manager field in the widget class record) is NULL, it issues an error.
•If the widget’s being_destroyed field is True, it returns XtGeometryNo.
•If the widget x, y, width, height, and border_width fields are already equal to the requested values, it returns XtGeometryYes; otherwise, it calls the parent’s geometry_manager method with the given parameters.
•If the parent’s geometry manager returns XtGeometryYes, if XtCWQueryOnly is not set in request_mode (see Structures below for details), and if the widget is realized, then XtMakeGeometryRequest calls the Xlib XConfigureWindow function to adjust the widget’s window (setting its size, location, and stacking order as appropriate).
•If the geometry manager returns XtGeometryDone, the change has been approved and actually has been done. In this case, XtMakeGeometryRequest does no configuring and returns XtGeometryYes. XtMakeGeometryRequest never returns XtGeometryDone.
Otherwise, XtMakeGeometryRequest returns the resulting value from the parent’s geometry manager.
Children of primitive widgets are always unmanaged; thus, XtMakeGeometryRequest always returns XtGeometryYes when called by a child of a primitive widget.
Structures
The return codes from geometry managers are:
typedef enum _XtGeometryResult {
XtGeometryYes, /∗ Request accepted ∗/
XtGeometryNo, /∗ Request denied ∗/
XtGeometryAlmost,/∗ Request denied but willing to take reply ∗/
XtGeometryDone /∗ Request accepted and done ∗/
} XtGeometryResult;
The XtWidgetGeometry structure is similar to 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:
#define XtCWQueryOnly (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
XtSMDontChange indicates that the widget wants its current stacking order preserved. For precise definitions of Above, Below, TopIf, BottomIf, and Opposite, see the reference page for XConfigureWindow in Volume Two, Xlib Reference Manual.