Module: Gtk::Native

Defined in:
(unknown)

Overview

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 [methodGtk.Widget.get_native].

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

In addition to a [classGdk.Surface], a GtkNative also provides a [classGsk.Renderer] for rendering on that surface. To get the renderer, use [methodGtk.Native.get_renderer].

Instance Method Summary collapse

Instance Method Details

#get_surface_transform(x, y) ⇒ nil

Retrieves the surface transform of self.

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

Parameters:

  • x (Float)

    return location for the x coordinate

  • y (Float)

    return location for the y coordinate

Returns:

  • (nil)

#realizenil

Realizes a GtkNative.

This should only be used by subclasses.

Returns:

  • (nil)

#rendererGsk::Renderer

Returns the renderer that is used for this GtkNative.

Returns:

  • (Gsk::Renderer)

    the renderer for self

#surfaceGdk::Surface

Returns the surface of this GtkNative.

Returns:

#unrealizenil

Unrealizes a GtkNative.

This should only be used by subclasses.

Returns:

  • (nil)