WindowControlsProtocol

public protocol WindowControlsProtocol : WidgetProtocol

GtkWindowControls 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 [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.

  • ptr

    Untyped pointer to the underlying GtkWindowControls instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • window_controls_ptr Default implementation

    Typed pointer to the underlying GtkWindowControls instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkWindowControls instance.

    Declaration

    Swift

    var window_controls_ptr: UnsafeMutablePointer<GtkWindowControls>! { get }
  • Required Initialiser for types conforming to WindowControlsProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

WindowControls Class

  • Bind a WindowControlsPropertyName source 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 : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a WindowControls property

    Declaration

    Swift

    @inlinable
    func get(property: WindowControlsPropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    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

    property

    the property to get the value for

    Return Value

    the value of the named property

WindowControls Class: WindowControlsProtocol extension (methods and fields)

  • getDecorationLayout() Extension method

    Gets the decoration layout of this GtkWindowControls.

    Declaration

    Swift

    @inlinable
    func getDecorationLayout() -> String!
  • getEmpty() Extension method

    Gets whether the widget has any window buttons.

    Declaration

    Swift

    @inlinable
    func getEmpty() -> Bool
  • getSide() Extension method

    Gets the side to which this GtkWindowControls instance belongs.

    Declaration

    Swift

    @inlinable
    func getSide() -> GtkPackType
  • setDecoration(layout:) Extension method

    Sets the decoration layout for the title buttons.

    This overrides the [propertyGtk.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 [propertyGtk.WindowControls:side] value is GTK_PACK_START, self will 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 GtkWindowControls uses.

    See [propertyGtk.WindowControls:decoration-layout].

    Declaration

    Swift

    @inlinable
    func set(side: GtkPackType)
  • decorationLayout Extension method

    Gets the decoration layout of this GtkWindowControls.

    Declaration

    Swift

    @inlinable
    var decorationLayout: String! { get nonmutating set }
  • empty Extension method

    Whether the widget has any window buttons.

    Declaration

    Swift

    @inlinable
    var empty: Bool { get }
  • side Extension method

    Whether the widget shows start or end side of the decoration layout.

    See [propertyGtk.WindowControls:decoration_layout].

    Declaration

    Swift

    @inlinable
    var side: GtkPackType { get nonmutating set }