It derives from <GtkWidget>.
Shows window frame controls.
Typical window frame controls are minimize, maximize and close buttons, and the window icon.
<GtkWindowControls> only displays start or
end side of the controls (see window-controls:side), so it’s intended to be always used in
pair with another <GtkWindowControls> for
the opposite side, for example:
<object class="GtkBox">
<child>
<object class="GtkWindowControls">
<property name="side">start</property>
</object>
</child>
...
<child>
<object class="GtkWindowControls">
<property name="side">end</property>
</object>
</child>
</object>
windowcontrols ├── [image.icon] ├── [button.minimize] ├── [button.maximize] ╰── [button.close]
A <GtkWindowControls>’ CSS node is called
windowcontrols. It contains subnodes corresponding to each title
button. Which of the title buttons exist and where they are placed
exactly depends on the desktop environment and window-controls:decoration-layout value.
When window-controls:empty
is true, it gets the .empty style class.
<GtkWindowControls> uses the
Gtk.AccessibleRole.group role.
The decoration layout for window buttons.
If this property is not set, the settings:gtk-decoration-layout setting is used.
Its value is a string, or #f.
Set it with (set! (window-controls:decoration-layout self)
value).
Whether the widget has any window buttons.
Its value is a boolean.
It is read only.
Whether the widget shows start or end side of the decoration layout.
See Gtk.WindowControls:decoration_layout.
Its value is a <GtkPackType> (or, to set it, one
of its symbols).
Set it with (set! (window-controls:side self) value).
Whether to show platform native close/minimize/maximize buttons.
For macOS, the header-bar:decoration-layout property controls the
use of native window controls.
On other platforms, this option has no effect.
See also Using GTK on Apple macOS.
Its value is a boolean.
Set it with (set! (window-controls:use-native-controls self)
value).
Gets the decoration layout of this window controls widget
Passed: a <GtkWindowControls>.
a window controls widget
Returned: a string, or #f.
the decoration layout
Gets whether the widget has any window buttons.
Passed: a <GtkWindowControls>.
a window controls widget
Returned: a boolean.
true if the widget has window buttons
Gets the side to which this window controls widget belongs.
Passed: a <GtkWindowControls>.
a window controls widget
Returned: a <GtkPackType>.
the side
Returns whether platform native window controls are shown.
Passed: a <GtkWindowControls>.
a window controls widget
Returned: a boolean.
true if native window controls are shown
Creates a new <GtkWindowControls>.
Passed: a <GtkPackType>, or one of its symbols.
the side
Returned: a <GtkWidget>.
a new <GtkWindowControls>
Sets the decoration layout for the title buttons.
This overrides the settings:gtk-decoration-layout setting.
The format of the string is button names, separated by commas. A colon separates the buttons that should appear on the left from those on the right. Recognized button names are minimize, maximize, close and icon (the window icon).
For example, “icon:minimize,maximize,close” specifies a icon on the left, and minimize, maximize and close buttons on the right.
If window-controls:side value
is Gtk.PackType.start, self will display the part before
the colon, otherwise after that.
Passed: a <GtkWindowControls>.
a window controls widget
Passed, or left out: a string, or #f.
a decoration layout, or NULL to unset the layout
Determines which part of decoration layout the window controls widget uses.
See window-controls:decoration-layout.
Passed: a <GtkWindowControls>.
a window controls widget
Passed: a <GtkPackType>, or one of its symbols.
a side
Sets whether platform native window controls are used.
This option shows the "stoplight" buttons on macOS. For Linux, this option has no effect.
See also Using GTK on Apple macOS.
Passed: a <GtkWindowControls>.
a window_controls widget
Passed: a boolean.
true to show native window controls