:right-sidebar: True CairoContext =================================================================== .. currentmodule:: gi.repository.Gdk .. class:: CairoContext(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gdk.DrawContext`, :class:`~gi.repository.GObject.Object` ``GdkCairoContext`` is an object representing the platform-specific draw context. ``GdkCairoContext``\s are created for a surface using :obj:`~gi.repository.Gdk.Surface.create_cairo_context`\, and the context can then be used to draw on that surface. Methods ------- .. rst-class:: interim-class .. class:: CairoContext :no-index: .. method:: cairo_create() -> ~gi.repository.cairo.Context | None Retrieves a Cairo context to be used to draw on the ``GdkSurface`` of ``context``\. A call to :obj:`~gi.repository.Gdk.DrawContext.begin_frame` with this ``context`` must have been done or this function will return :const:`None`. The returned context is guaranteed to be valid until :obj:`~gi.repository.Gdk.DrawContext.end_frame` is called.