Package: gdk

Function gdk-cairo-create

Lambda List

gdk-cairo-create (window)

Arguments

window -- a gdk-window object

Return Value

A newly created cairo-t context. Free with the cairo-destroy function when you are done drawing.

Details

Creates a Cairo context for drawing to window.

Note that calling the cairo-reset-clip function on the resulting cairo-t context will produce undefined results, so avoid it at all costs.

Typically, this function is used to draw on a gdk-window object out of the paint cycle of the toolkit. This should be avoided, as it breaks various assumptions and optimizations.

If you are drawing on a native gdk-window object in response to a :expose event you should use the gdk-window-begin-draw-frame and gdk-drawing-context-get-cairo-context functions instead. GTK will automatically do this for you when drawing a widget.

Warning

The gdk-cairo-create function has been deprecated since version 3.22 and should not be used in newly written code. Use the gdk-window-begin-draw-frame and gdk-drawing-context-cairo-context functions instead.
 

See also

2021-12-11