Gtk.Native

g GObject.GInterface GObject.GInterface Gtk.Native Gtk.Native GObject.GInterface->Gtk.Native

Implementations:

Gtk.DragIcon, Gtk.Popover, Gtk.Window

Methods

class

get_for_surface (surface)

get_renderer ()

get_surface ()

get_surface_transform ()

realize ()

unrealize ()

Virtual Methods

None

Properties

None

Signals

None

Fields

None

Class Details

class Gtk.Native
Bases:

GObject.GInterface

Structure:

Gtk.NativeInterface

GtkNative is the interface implemented by all widgets that have their own GdkSurface.

The obvious example of a GtkNative is GtkWindow.

Every widget that is not itself a GtkNative is contained in one, and you can get it with [method`Gtk`.Widget.get_native].

To get the surface of a GtkNative, use [method`Gtk`.Native.get_surface]. It is also possible to find the GtkNative to which a surface belongs, with [func`Gtk`.Native.get_for_surface].

In addition to a [class`Gdk`.Surface], a GtkNative also provides a [class`Gsk`.Renderer] for rendering on that surface. To get the renderer, use [method`Gtk`.Native.get_renderer].

classmethod get_for_surface(surface)[source]
Parameters:

surface (Gdk.Surface) – a GdkSurface

Returns:

the GtkNative that is associated with surface

Return type:

Gtk.Native or None

Finds the GtkNative associated with the surface.

get_renderer()[source]
Returns:

the renderer for self

Return type:

Gsk.Renderer

Returns the renderer that is used for this GtkNative.

get_surface()[source]
Returns:

the surface of self

Return type:

Gdk.Surface

Returns the surface of this GtkNative.

get_surface_transform()[source]
Returns:

x:

return location for the x coordinate

y:

return location for the y coordinate

Return type:

(x: float, y: float)

Retrieves the surface transform of self.

This is the translation from self's surface coordinates into self's widget coordinates.

realize()[source]

Realizes a GtkNative.

This should only be used by subclasses.

unrealize()[source]

Unrealizes a GtkNative.

This should only be used by subclasses.