C+
Packages · View as Markdown
v0.0.27 is a macOS / AppKit release. That is the supported path. Other platforms are not recommended; wait for a later version.

gtk4

Not recommended on v0.0.27. This version is a macOS / AppKit release. Other platforms exist in the tree; do not ship on them yet. See the manual overview.

Generated bindings for GTK 4, produced by cpc-bindgen --gobject from GIR. The package name is gtk4. There is no hand-written gtk package.

import "gtk4/gtk4" as gtk;

let app: gtk::Application = gtk::Application::new("org.example.Hello", 0 as u32);
let win: gtk::ApplicationWindow = gtk::ApplicationWindow::new(app);
let btn: gtk::Button = gtk::Button::new();

Strings are str (the GObject bridge allocates the C string). Handles are non-owning { _raw } wrappers. Lifetime and signals live in gobject. The generated gio binding skips g_application_run; facet_gtk hand-binds the run loop.

Peers generated the same way, listed on Packages: glib, gobject, gio, cairo, pango, gdk. For GNOME widgets on top of GTK 4, see adwaita.