Windows
A GTK application is a set of Gtk.Windows, and everything on this page is either the
chrome around one or the window itself. The header bar is the titlebar: children
packed at the start and at the end, the window’s title in the middle, and the
minimize, maximize and close buttons GTK would otherwise have to ask the window
manager for. The window controls are those buttons on their own — one side of
them — and the action bar is the bottom bar, which libadwaita styles but does not
own.
The two window classes come last, and both are the same shape: a window with a
titlebar and a child, and an application window, which is a window that also knows
about a GtkApplication and can show its menubar.
Header Bar
Section titled “Header Bar”GTK’s titlebar widget. start packs from the start and end from the end — and packing from the end PREPENDS, so the first end child sits nearest the edge and each later one lands in front of it. A child with no placement packs from the start.
The middle is the window’s title, and it is a plain label rather than a window-title
widget: Gtk.HeaderBar has no title property at all, it derives the label from the
window it is in, and a title child replaces it. show-title-buttons CREATES the two
window-control groups and REMOVES them again, so show-title-buttons="false" is a
different bar, not a hidden one.
Window Controls
Section titled “Window Controls”One side of the frame buttons, and the whole decision table behind them. The
decoration layout is split on the first colon, side picks a half, and each token of
that half builds one button — or none:
| token | built when |
|---|---|
icon | the window is sovereign: neither modal nor transient-for, and it has an icon |
minimize | the window is sovereign |
maximize | the window is sovereign and resizable — and it shows the restore glyph while maximized |
close | the window is deletable |
A controls bar outside a window draws nothing: that is GTK
(gtkwindowcontrols.c:257-264), not this port, which is why the preview wraps each one
in a window.
Action Bar
Section titled “Action Bar”GTK’s bottom bar, and the one libadwaita styles without owning: its rules are
actionbar > revealer > box, which is a bar with two packed ends and a centre.
start appends, end prepends, and center is a real placement with no property
behind it — GTK has set_center_widget but no center-widget property, so
Gtk.Builder refuses a .blp that writes one.
revealed is the one property, and it defaults to true.
Window
Section titled “Window”A toplevel: a child, a titlebar since GTK 4.6, and the properties that decide what
its chrome shows. Close emits close-request first, and only acts on it if nothing
handled it — hiding the window when hide-on-close is set and destroying it otherwise.
Application Window
Section titled “Application Window”A Gtk.Window that integrates with a GtkApplication. Window-specific actions are
exported under win. and application-wide ones under app., and any GtkActionable
inside the window can activate either — so a button in this window can drive the whole
application, not just itself.
The one property of its own is show-menubar, and the bar comes from the application’s menu model, not from the window. GTK shows it only when the property is set and the model has at least one item.
Related
Section titled “Related”- Layout: the boxes and the separators that fill a window’s content.
- Adwaita Layout:
Adw.HeaderBar,Adw.ToolbarViewandAdw.WindowTitle— the Adwaita half of the same chrome, and the ones to write in a new app. - Buttons: the
flatbuttons the frame slots above are built from. - Adwaita Storybook: the same widgets in a live component browser you can poke at.