Native

class Native(*args, **kwargs)

Implementations: AboutDialog, AppChooserDialog, ApplicationWindow, Assistant, ColorChooserDialog, Dialog, DragIcon, EmojiChooser, FileChooserDialog, FontChooserDialog, MessageDialog, PageSetupUnixDialog, Popover, PopoverMenu, PrintUnixDialog, ShortcutsWindow, Window

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 get_native.

To get the surface of a GtkNative, use get_surface. It is also possible to find the GtkNative to which a surface belongs, with get_for_surface.

In addition to a Surface, a GtkNative also provides a Renderer for rendering on that surface. To get the renderer, use get_renderer.

Methods

class Native
get_for_surface(surface: Surface) Native | None

Finds the GtkNative associated with the surface.

Parameters:

surface – a GdkSurface

get_renderer() Renderer | None

Returns the renderer that is used for this GtkNative.

get_surface() Surface | None

Returns the surface of this GtkNative.

get_surface_transform() tuple[float, float]

Retrieves the surface transform of self.

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

realize() None

Realizes a GtkNative.

This should only be used by subclasses.

unrealize() None

Unrealizes a GtkNative.

This should only be used by subclasses.