C+
Packages · View as Markdown

gtk4

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.