Name
XtTranslateCoords — translate an x-y coordinate pair from widget coordinates to root coordinates.
Synopsis
void XtTranslateCoords(w, x, y, root_x_return, root_y_return)
Widget w;
Position x, y;
Position ∗root_x_return, ∗root_y_return;
Arguments
wSpecifies the widget.
x, ySpecify the widget-relative x and y coordinates.
root_x_return, root_y_return
Return the root-relative x and y coordinates.
Description
XtTranslateCoords converts widget-relative coordinates to screen-relative coordinates. This is useful in popping up a pop-up shell, since it must be explicitly moved from its default location at the upper-left corner of the screen.
The display height and width can be obtained in pixels with the Xlib macros XDisplayHeight and XDisplayWidth, and in millimeters with the Xlib macros XDisplayHeightMM and XDisplayWidthMM.
These macros require a display and screen, which can be returned by Intrinsics functions. An example might be:
height = XDisplayHeight(XtDisplay(w), XtScreen(w));
XtTranslateCoords is similar to the Xlib XTranslateCoordinates function, which also translates window-relative coordinates to display-relative coordinates. But XtTranslateCoords does not generate a server request because the required information is already in the widget’s data structures.