Adw.Window

g Adw.Window Adw.Window 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 Gtk.Native Gtk.Native GObject.GInterface->Gtk.Native Gtk.Root Gtk.Root GObject.GInterface->Gtk.Root Gtk.ShortcutManager Gtk.ShortcutManager GObject.GInterface->Gtk.ShortcutManager 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.Window Gtk.Window Gtk.Native->Gtk.Window Gtk.Root->Gtk.Window Gtk.ShortcutManager->Gtk.Window Gtk.Widget->Gtk.Window Gtk.Window->Adw.Window

Subclasses:

Adw.AboutWindow, Adw.PreferencesWindow

Methods

Inherited:

Gtk.Window (62), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Native (6), Gtk.Root (3)

Structs:

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

class

new ()

add_breakpoint (breakpoint)

get_content ()

get_current_breakpoint ()

get_dialogs ()

get_visible_dialog ()

set_content (content)

Virtual Methods

Inherited:

Gtk.Window (5), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.ShortcutManager (2)

Properties

Inherited:

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

Name

Type

Flags

Short Description

content

Gtk.Widget

r/w/en

current-breakpoint

Adw.Breakpoint

r

dialogs

Gio.ListModel

r

visible-dialog

Adw.Dialog

r

Signals

Inherited:

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

Fields

Inherited:

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

Name

Type

Access

Description

parent_instance

Gtk.Window

r

Class Details

class Adw.Window(*args, **kwargs)
Bases:

Gtk.Window

Abstract:

No

Structure:

Adw.WindowClass

A freeform window.

<picture> <source srcset=”window-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”window.png” alt=”window”> </picture>

The AdwWindow widget is a subclass of [class`Gtk`.Window] which has no titlebar area. Instead, [class`ToolbarView`] can be used together with [class`HeaderBar`] or [class`Gtk`.HeaderBar] as follows:

``xml <object class=”AdwWindow”>

<property name=”content”>
<object class=”AdwToolbarView”>
<child type=”top”>

<object class=”AdwHeaderBar”/>

</child> <property name=”content”>

<!– … –>

</property>

</object>

</property>

</object> ``

Using [property`Gtk`.Window:titlebar] or [property`Gtk`.Window:child] is not supported and will result in a crash. Use [property`Window`:py:data::content<Adw.Window.props.content>] instead.

Dialogs

AdwWindow can contain [class`Dialog`]. Use [method`Dialog`.present] with the window or a widget within a window to show a dialog.

Breakpoints

AdwWindow can be used with [class`Breakpoint`] the same way as [class`BreakpointBin`]. Refer to that widget’s documentation for details.

Example:

``xml <object class=”AdwWindow”>

<property name=”width-request”>360</property> <property name=”height-request”>200</property> <property name=”content”>

<object class=”AdwToolbarView”>
<child type=”top”>

<object class=”AdwHeaderBar”/>

</child> <property name=”content”>

<!– … –>

</property> <child type=”bottom”>

<object class=”GtkActionBar” id=”bottom_bar”>

<property name=”revealed”>True</property> <property name=”visible”>False</property>

</object>

</child>

</object>

</property> <child>

<object class=”AdwBreakpoint”>

<condition>max-width: 500px</condition> <setter object=”bottom_bar” property=”visible”>True</setter>

</object>

</child>

</object> ``

Like AdwBreakpointBin, if breakpoints are used, AdwWindow doesn’t have a minimum size, and [property`Gtk`.Widget:width-request] and [property`Gtk`.Widget:height-request] properties must be set manually.

classmethod new()
Returns:

the newly created AdwWindow

Return type:

Gtk.Widget

Creates a new AdwWindow.

add_breakpoint(breakpoint)
Parameters:

breakpoint (Adw.Breakpoint) – the breakpoint to add

Adds breakpoint to self.

New in version 1.4.

get_content()
Returns:

the content widget of self

Return type:

Gtk.Widget or None

Gets the content widget of self.

This method should always be used instead of [method`Gtk`.Window.get_child].

get_current_breakpoint()
Returns:

the current breakpoint

Return type:

Adw.Breakpoint or None

Gets the current breakpoint.

New in version 1.4.

get_dialogs()
Returns:

a list model for the dialogs of self

Return type:

Gio.ListModel

Returns a [iface`Gio`.ListModel] that contains the open dialogs of self.

This can be used to keep an up-to-date view.

New in version 1.5.

get_visible_dialog()
Returns:

the visible dialog

Return type:

Adw.Dialog or None

Returns the currently visible dialog in self, if there’s one.

New in version 1.5.

set_content(content)
Parameters:

content (Gtk.Widget or None) – the content widget

Sets the content widget of self.

This method should always be used instead of [method`Gtk`.Window.set_child].

Property Details

Adw.Window.props.content
Name:

content

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The content widget.

This property should always be used instead of [property`Gtk`.Window:child].

Adw.Window.props.current_breakpoint
Name:

current-breakpoint

Type:

Adw.Breakpoint

Default Value:

None

Flags:

READABLE

The current breakpoint.

New in version 1.4.

Adw.Window.props.dialogs
Name:

dialogs

Type:

Gio.ListModel

Default Value:

None

Flags:

READABLE

The open dialogs.

New in version 1.5.

Adw.Window.props.visible_dialog
Name:

visible-dialog

Type:

Adw.Dialog

Default Value:

None

Flags:

READABLE

The currently visible dialog

New in version 1.5.