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 with the x coordinate in child's coordinate system
y -- a number with the y coordinate in child's coordinate system

Return Value

parent-x -- a :double with the x coordinate in parent's coordinate system, or nil
parent-y -- a :double 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 function gdk-window-parent for normal windows, and the window's embedder as returned by the function gdk-offscreen-window-embedder for offscreen windows.

For normal windows, calling this function is equivalent to adding the return values of the function gdk-window-position 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 function gdk-window-coords-from-parent.
 

See also

2020-9-25