:right-sidebar: True Native =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: Native(*args, **kwargs) :no-contents-entry: Implementations: :class:`~gi.repository.Gtk.AboutDialog`, :class:`~gi.repository.Gtk.AppChooserDialog`, :class:`~gi.repository.Gtk.ApplicationWindow`, :class:`~gi.repository.Gtk.Assistant`, :class:`~gi.repository.Gtk.ColorChooserDialog`, :class:`~gi.repository.Gtk.Dialog`, :class:`~gi.repository.Gtk.DragIcon`, :class:`~gi.repository.Gtk.EmojiChooser`, :class:`~gi.repository.Gtk.FileChooserDialog`, :class:`~gi.repository.Gtk.FontChooserDialog`, :class:`~gi.repository.Gtk.MessageDialog`, :class:`~gi.repository.Gtk.PageSetupUnixDialog`, :class:`~gi.repository.Gtk.Popover`, :class:`~gi.repository.Gtk.PopoverMenu`, :class:`~gi.repository.Gtk.PrintUnixDialog`, :class:`~gi.repository.Gtk.ShortcutsWindow`, :class:`~gi.repository.Gtk.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 :obj:`~gi.repository.Gtk.Widget.get_native`. To get the surface of a ``GtkNative``, use :obj:`~gi.repository.Gtk.Native.get_surface`. It is also possible to find the ``GtkNative`` to which a surface belongs, with :obj:`~gi.repository.Gtk.Native.get_for_surface`. In addition to a :obj:`~gi.repository.Gdk.Surface`, a ``GtkNative`` also provides a :obj:`~gi.repository.Gsk.Renderer` for rendering on that surface. To get the renderer, use :obj:`~gi.repository.Gtk.Native.get_renderer`. Methods ------- .. rst-class:: interim-class .. class:: Native :no-index: .. method:: get_for_surface(surface: ~gi.repository.Gdk.Surface) -> ~gi.repository.Gtk.Native | None Finds the ``GtkNative`` associated with the surface. :param surface: a ``GdkSurface`` .. method:: get_renderer() -> ~gi.repository.Gsk.Renderer | None Returns the renderer that is used for this ``GtkNative``. .. method:: get_surface() -> ~gi.repository.Gdk.Surface | None Returns the surface of this ``GtkNative``. .. method:: 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. .. method:: realize() -> None Realizes a ``GtkNative``. This should only be used by subclasses. .. method:: unrealize() -> None Unrealizes a ``GtkNative``. This should only be used by subclasses.