1.217 <GtkWindowControls>

Class: <GtkWindowControls>

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>

CSS nodes

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.

Accessibility

<GtkWindowControls> uses the Gtk.AccessibleRole.group role.

Properties

Property: window-controls:decoration-layout self

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).

Property: window-controls:empty self

Whether the widget has any window buttons.

Its value is a boolean.

It is read only.

Property: window-controls:side self

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).

Property: window-controls:use-native-controls self

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).

Procedures

Method: window-controls:get-decoration-layout self ⇒ %return
Method: get-decoration-layout self ⇒ %return

Gets the decoration layout of this window controls widget

self

Passed: a <GtkWindowControls>.

a window controls widget

%return

Returned: a string, or #f.

the decoration layout

Method: window-controls:get-empty? self ⇒ %return
Method: get-empty? self ⇒ %return

Gets whether the widget has any window buttons.

self

Passed: a <GtkWindowControls>.

a window controls widget

%return

Returned: a boolean.

true if the widget has window buttons

Method: window-controls:get-side self ⇒ %return
Method: get-side self ⇒ %return

Gets the side to which this window controls widget belongs.

self

Passed: a <GtkWindowControls>.

a window controls widget

%return

Returned: a <GtkPackType>.

the side

Method: window-controls:get-use-native-controls? self ⇒ %return
Method: get-use-native-controls? self ⇒ %return

Returns whether platform native window controls are shown.

self

Passed: a <GtkWindowControls>.

a window controls widget

%return

Returned: a boolean.

true if native window controls are shown

Procedure: window-controls:new side ⇒ %return

Creates a new <GtkWindowControls>.

side

Passed: a <GtkPackType>, or one of its symbols.

the side

%return

Returned: a <GtkWidget>.

a new <GtkWindowControls>

Method: window-controls:set-decoration-layout self [layout]
Method: set-decoration-layout self [layout]

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.

self

Passed: a <GtkWindowControls>.

a window controls widget

layout

Passed, or left out: a string, or #f.

a decoration layout, or NULL to unset the layout

Method: window-controls:set-side self side
Method: set-side self side

Determines which part of decoration layout the window controls widget uses.

See window-controls:decoration-layout.

self

Passed: a <GtkWindowControls>.

a window controls widget

side

Passed: a <GtkPackType>, or one of its symbols.

a side

Method: window-controls:set-use-native-controls self setting
Method: set-use-native-controls self setting

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.

self

Passed: a <GtkWindowControls>.

a window_controls widget

setting

Passed: a boolean.

true to show native window controls