Function

Gdkcairo_create

deprecated: 3.22 since: 2.8

Declaration [src]

cairo_t*
gdk_cairo_create (
  GdkWindow* window
)

Description [src]

Creates a Cairo context for drawing to window.

Note that calling cairo_reset_clip() on the resulting #cairo_t will produce undefined results, so avoid it at all costs.

Typically, this function is used to draw on a GdkWindow 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 GdkWindow in response to a GDK_EXPOSE event you should use gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context() instead. GTK will automatically do this for you when drawing a widget.

Available since: 2.8

Deprecated since: 3.22

Use gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context() instead.

Parameters

window

Type: GdkWindow

A GdkWindow.

The data is owned by the caller of the function.

Return value

Type: cairo_t

A newly created Cairo context. Free with cairo_destroy() when you are done drawing.

The caller of the function takes ownership of the data, and is responsible for freeing it.