Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: WindowControls

[31:7] extends: object

Shows window frame controls. Typical window frame controls are minimize, maximize and close buttons, and the window icon. An example GtkWindowControls GtkWindowControls only displays start or end side of the controls (see [property@Gtk.WindowControls:side]), so it's intended to be always used in pair with another GtkWindowControls for the opposite side, for example:

<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
[property@Gtk.WindowControls:decoration-layout] value. When
[property@Gtk.WindowControls:empty] is true, it gets the .empty style class.
# Accessibility `GtkWindowControls` uses the [enum@Gtk.AccessibleRole.group]
role.

#### Members
- **handleObj**
- **lib**
- **retainedCallbacks**
- **signalHandlerNames**
- **signalSetterHandlers**

#### Methods

- **WindowControls** (`side = null`)

	> Creates a new `GtkWindowControls`.

	- **@p** `side` is the side.


- **toNativeHandle** (`Source`)

	> Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from `fn.call(...)`, another generated wrapper exposing `handle()`, or null. Returns null when the argument carries no pointer.

	- **@p** `Source` is the raw handle, raw buffer, wrapper, or null.
	- **@r** `A` raw pointer carrier or null when no pointer is present.


- **getLib** ()

	> Returns the opened native library for this generated wrapper.

	- **@r** `The` opened native library.


- **handle** ()

	> Returns the wrapped NativeHandle.

	- **@r** `The` wrapped NativeHandle.


- **isNull** ()

	> Returns true when the wrapped handle is null.

	- **@r** `A` bool.


- **describe** ()

	> Returns a small string for debugging generated wrappers.

	- **@r** `A` string.


- **asWidget** ()

	> Wraps this handle as `Widget`.

	- **@r** `A` `Widget` object.


- **asAccessible** ()

	> Wraps this handle as `Accessible`.

	- **@r** `A` `Accessible` object.


- **asBuildable** ()

	> Wraps this handle as `Buildable`.

	- **@r** `A` `Buildable` object.


- **asConstraintTarget** ()

	> Wraps this handle as `ConstraintTarget`.

	- **@r** `A` `ConstraintTarget` object.


- **getProperty** (`string Name`)

	> Reads one generated property by name.



- **setProperty** (`string Name, Value`)

	> Writes one generated property by name.



- **setDecorationlayout** (`string Value`)

	> The decoration layout for window buttons. If this property is not set, the [property@Gtk.Settings:gtk-decoration-layout] setting is used.

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setSide** (`string Value`)

	> Whether the widget shows start or end side of the decoration layout. See [property@Gtk.WindowControls:decoration_layout].

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **setUsenativecontrols** (`bool Value`)

	> Whether to show platform native close/minimize/maximize buttons. For macOS, the [property@Gtk.HeaderBar: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](osx.html?native-window-controls).

	- **@p** `Value` is the new property value.
	- **@r** `None.` 


- **get\_decoration\_layout** ()

	> Gets the decoration layout of this window controls widget



- **get\_empty** ()

	> Gets whether the widget has any window buttons.



- **get\_side** ()

	> Gets the side to which this window controls widget belongs.



- **get\_use\_native\_controls** ()

	> Returns whether platform native window controls are shown.



- **set\_decoration\_layout** (`string layout`)

	> Sets the decoration layout for the title buttons. This overrides the [property@Gtk.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 [property@Gtk.WindowControls:side] value is [enum@Gtk.PackType.start],

	- **@self** `will` display the part before the colon, otherwise after that.
	- **@p** `layout` is a decoration layout, or `NULL` to unset the layout.
	- **@r** `None.` 


- **set\_side** (`string side`)

	> Determines which part of decoration layout the window controls widget uses. See [property@Gtk.WindowControls:decoration-layout].

	- **@p** `side` is a side.
	- **@r** `None.` 


- **set\_use\_native\_controls** (`bool 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](osx.html?native-window-controls).

	- **@p** `setting` is true to show native window controls.
	- **@r** `None.` 




## class: WindowControlsMeta

[290:14] `static` **extends: object** 

Generated metadata helpers for `WindowControls` class surfaces.

#### Methods

- **properties** ()

	> Returns property metadata for `WindowControls`.

	- **@r** `A` list.