WindowControlsProtocol
public protocol WindowControlsProtocol : WidgetProtocol
GtkWindowControls 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
[propertyGtk.WindowControls: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 [propertyGtk.WindowControls:decoration-layout] value.
When [propertyGtk.WindowControls:empty] is true, it gets the .empty
style class.
Accessibility
GtkWindowControls uses the GTK_ACCESSIBLE_ROLE_GROUP role.
The WindowControlsProtocol protocol exposes the methods and properties of an underlying GtkWindowControls instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see WindowControls.
Alternatively, use WindowControlsRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkWindowControlsinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
window_controls_ptrDefault implementationTyped pointer to the underlying
GtkWindowControlsinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkWindowControlsinstance.Declaration
Swift
var window_controls_ptr: UnsafeMutablePointer<GtkWindowControls>! { get } -
Required Initialiser for types conforming to
WindowControlsProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
WindowControlsPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: WindowControlsPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a WindowControls property
Declaration
Swift
@inlinable func get(property: WindowControlsPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a WindowControls property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: WindowControlsPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
getDecorationLayout()Extension methodGets the decoration layout of this
GtkWindowControls.Declaration
Swift
@inlinable func getDecorationLayout() -> String! -
getEmpty()Extension methodGets whether the widget has any window buttons.
Declaration
Swift
@inlinable func getEmpty() -> Bool -
getSide()Extension methodGets the side to which this
GtkWindowControlsinstance belongs.Declaration
Swift
@inlinable func getSide() -> GtkPackType -
setDecoration(layout:Extension method) 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 isGTK_PACK_START,selfwill display the part before the colon, otherwise after that.Declaration
Swift
@inlinable func setDecoration(layout: UnsafePointer<CChar>? = nil) -
set(side:Extension method) Determines which part of decoration layout the
GtkWindowControlsuses.See [property
Gtk.WindowControls:decoration-layout].Declaration
Swift
@inlinable func set(side: GtkPackType) -
decorationLayoutExtension methodGets the decoration layout of this
GtkWindowControls.Declaration
Swift
@inlinable var decorationLayout: String! { get nonmutating set } -
emptyExtension methodWhether the widget has any window buttons.
Declaration
Swift
@inlinable var empty: Bool { get } -
sideExtension methodWhether the widget shows start or end side of the decoration layout.
See [property
Gtk.WindowControls:decoration_layout].Declaration
Swift
@inlinable var side: GtkPackType { get nonmutating set }
View on GitHub
Install in Dash
WindowControlsProtocol Protocol Reference