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
- Gtk::AboutDialog
- Gtk::AppChooserDialog
- Gtk::ApplicationWindow
- Gtk::Assistant
- Gtk::ColorChooserDialog
- Gtk::Dialog
- Gtk::DragIcon
- Gtk::EmojiChooser
- Gtk::FileChooserDialog
- Gtk::FontChooserDialog
- Gtk::MessageDialog
- Gtk::PageSetupUnixDialog
- Gtk::Popover
- Gtk::PopoverMenu
- Gtk::PrintUnixDialog
- Gtk::ShortcutsWindow
- Gtk::Window
Defined in:
lib/gi-crystal/src/auto/gtk-4.0/native.crConstructors
-
.cast(obj : GObject::Object) : self
Cast a
GObject::Object
toself
, throws aTypeCastError
if the cast can't be made.
Class Method Summary
- .cast?(obj : GObject::Object) : self | Nil
- .for_surface(surface : Gdk::Surface) : Gtk::Native | Nil
- .g_type : UInt64
Instance Method Summary
- #realize : Nil
- #renderer : Gsk::Renderer
- #surface : Gdk::Surface
- #surface_transform(x : Float64, y : Float64) : Nil
- #to_unsafe
- #unrealize : Nil
Constructor Detail
Cast a GObject::Object
to self
, throws a TypeCastError
if the cast can't be made.