Package: gdk

Function gdk:window-coords-to-parent

Lambda List

gdk:window-coords-to-parent (window x y)

Arguments

window -- a gdk:window child window
x -- a number coerced to a double float with the x coordinate in child's coordinate system
y -- a number coerced to a double float with the y coordinate in child's coordinate system

Return Value

xparent -- a double float with the x coordinate in parent's coordinate system, or nil
yparent -- a double float with the y coordinate in parent's coordinate system, or nil

Details

Transforms window coordinates from a child window to its parent window, where the parent window is the normal parent as returned by the gdk:window-parent function for normal windows, and the window's embedder as returned by the gdk:offscreen-window-embedder function for offscreen windows.

For normal windows, calling this function is equivalent to adding the return values of the gdk:window-position function to the child coordinates. For offscreen windows however, which can be arbitrarily transformed, this function calls the "to-embedder" signal to translate the coordinates.

You should always use this function when writing generic code that walks up a window hierarchy.

See also the gdk:window-coords-from-parent function.
 

See also

2023-2-26