module Gtk::Native

Overview

Gtk::Native is the interface implemented by all widgets that have their own Gdk::Surface.

The obvious example of a Gtk::Native is Gtk::Window.

Every widget that is not itself a Gtk::Native is contained in one, and you can get it with Gtk::Widget#native.

To get the surface of a Gtk::Native, use Gtk::Native#surface. It is also possible to find the Gtk::Native to which a surface belongs, with Gtk::Native#for_surface.

In addition to a Gdk::Surface, a Gtk::Native also provides a Gsk::Renderer for rendering on that surface. To get the renderer, use Gtk::Native#renderer.

Direct including types

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/native.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.cast(obj : GObject::Object) : self #

Cast a GObject::Object to self, throws a TypeCastError if the cast can't be made.


[View source]

Class Method Detail

def self.cast?(obj : GObject::Object) : self | Nil #

[View source]
def self.for_surface(surface : Gdk::Surface) : Gtk::Native | Nil #

[View source]
def self.g_type : UInt64 #

[View source]

Instance Method Detail

def realize : Nil #

[View source]
def renderer : Gsk::Renderer #

[View source]
def surface : Gdk::Surface #

[View source]
def surface_transform(x : Float64, y : Float64) : Nil #

[View source]
abstract def to_unsafe #

[View source]
def unrealize : Nil #

[View source]