developing-gtk-apps
Developing GTK Apps
Build robust GTK 4/libadwaita applications with correct architecture, lifecycle, and patterns.
Core principle: Get the foundation right before the UI. Application lifecycle, threading model, and resource management are where most GTK apps break.
Relationship to UI skill: This skill handles architecture and plumbing. For widget selection, layout, and HIG compliance, use designing-gnome-ui.
Pick the Language Branch First
Every run is a Vala run, a Python run, or a Rust run. Detect the language from the project — .vala sources or 'vala' in project() means Vala; .py sources with gi imports means Python; a Cargo.toml with a gtk4 dependency or .rs sources means Rust; for a new project, use the language the user named — then open that branch file before writing any code. Every code-level question (syntax, boilerplate, which function to call) is answered there, not here:
| Language | Open | Covers |
|---|---|---|
| Vala | vala-reference.md |
Boilerplate, ownership (owned/unowned/weak), signals, properties, list models/ListView, async/threads, templates, Meson, VAPI verification |
| Python | python-reference.md |
Boilerplate, GLib.idle_add, actions, GSettings, plus pointers into the deeper Python references |
| Rust | rust-reference.md |
Boilerplate, subclassing (mod imp/wrapper), clone!, properties, signals, list models/ListView, async/threads, templates, build, crate-source verification, compile traps keyed by error text |
When the project builds widget trees purely in code (no .ui files or .blp in the repo — a common house rule), stay on that path: skip the template/Blueprint/GResource material and build widgets by hand.