Gtk.WindowControls

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.WindowControls Gtk.WindowControls Gtk.Widget->Gtk.WindowControls

Example

../_images/WindowControls.png
Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (side)

get_decoration_layout ()

get_empty ()

get_side ()

set_decoration_layout (layout)

set_side (side)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

decoration-layout

str

r/w/en

empty

bool

r/en

side

Gtk.PackType

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Gtk.WindowControls(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Gtk.WindowControlsClass

GtkWindowControls shows window frame controls.

Typical window frame controls are minimize, maximize and close buttons, and the window icon.

An example Gtk.WindowControls

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:

```xml

<child>

start </object> </child>

<child>

end </object> </child> </object> ```

# CSS nodes

``` windowcontrols ├── [image.icon] ├── [button.minimize] ├── [button.maximize] ╰── [button.close] ```

A `:obj:Gtk.WindowControls`’ 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

`:obj:Gtk.WindowControls` uses the Gtk.AccessibleRole.GROUP role.

classmethod new(side)[source]
Parameters:

side (Gtk.PackType) – the side

Returns:

a new GtkWindowControls.

Return type:

Gtk.Widget

Creates a new GtkWindowControls.

get_decoration_layout()[source]
Returns:

the decoration layout or None if it is unset

Return type:

str or None

Gets the decoration layout of this GtkWindowControls.

get_empty()[source]
Returns:

True if the widget has window buttons, otherwise False

Return type:

bool

Gets whether the widget has any window buttons.

get_side()[source]
Returns:

the side

Return type:

Gtk.PackType

Gets the side to which this GtkWindowControls instance belongs.

set_decoration_layout(layout)[source]
Parameters:

layout (str or None) – a decoration layout, or None to unset the 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 Gtk.PackType.START, self will display the part before the colon, otherwise after that.

set_side(side)[source]
Parameters:

side (Gtk.PackType) – a side

Determines which part of decoration layout the GtkWindowControls uses.

See [property`Gtk`.WindowControls:decoration-layout].

Property Details

Gtk.WindowControls.props.decoration_layout
Name:

decoration-layout

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The decoration layout for window buttons.

If this property is not set, the [property`Gtk`.Settings:gtk-decoration-layout] setting is used.

Gtk.WindowControls.props.empty
Name:

empty

Type:

bool

Default Value:

True

Flags:

READABLE, EXPLICIT_NOTIFY

Whether the widget has any window buttons.

Gtk.WindowControls.props.side
Name:

side

Type:

Gtk.PackType

Default Value:

Gtk.PackType.START

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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

See [property`Gtk`.WindowControls:decoration_layout].