Class Native

All Implemented Interfaces:
PointerInterface

public class Native extends Interface
`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].

https://docs.gtk.org/gtk4/iface.Native.html

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getRenderer

      public Renderer getRenderer()
      Returns the renderer that is used for this `GtkNative`.
      Returns:
      the renderer for @self
    • getSurface

      public Surface getSurface()
      Returns the surface of this `GtkNative`.
      Returns:
      the surface of @self
    • realize

      public void realize()
      Realizes a `GtkNative`.

      This should only be used by subclasses.
    • unrealize

      public void unrealize()
      Unrealizes a `GtkNative`.

      This should only be used by subclasses.
    • getForSurface

      public static Native getForSurface(@Nonnull Surface surface)
      Finds the `GtkNative` associated with the surface.
      Parameters:
      surface - a `GdkSurface`
      Returns:
      the `GtkNative` that is associated with @surface
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()