ApplicationWindow#

class ApplicationWindow(*args, **kwargs)#

Superclasses: ApplicationWindow, Window, Widget, InitiallyUnowned, Object

Implemented Interfaces: ActionGroup, ActionMap, Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager

A freeform application window.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/application-window.png

AdwApplicationWindow is a ApplicationWindow subclass providing the same features as Window.

See Window for details.

Example of an AdwApplicationWindow UI definition:

<object class="AdwApplicationWindow">
  <property name="content">
    <object class="AdwToolbarView">
      <child type="top">
        <object class="AdwHeaderBar"/>
      </child>
      <property name="content">
        <!-- ... -->
      </property>
    </object>
  </property>
</object>

Using menubar is not supported and may result in visual glitches.

Constructors#

class ApplicationWindow
classmethod new(app: Application) Widget#

Creates a new AdwApplicationWindow for app.

Parameters:

app – an application instance

Methods#

class ApplicationWindow
add_breakpoint(breakpoint: Breakpoint) None#

Adds breakpoint to self.

Added in version 1.4.

Parameters:

breakpoint – the breakpoint to add

get_adaptive_preview() bool#

Gets whether adaptive preview for self is currently open.

Added in version 1.7.

get_content() Widget | None#

Gets the content widget of self.

This method should always be used instead of get_child.

get_current_breakpoint() Breakpoint | None#

Gets the current breakpoint.

Added in version 1.4.

get_dialogs() ListModel#

Returns a ListModel that contains the open dialogs of self.

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

Added in version 1.5.

get_visible_dialog() Dialog | None#

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

Added in version 1.5.

set_adaptive_preview(adaptive_preview: bool) None#

Sets whether adaptive preview for self is currently open.

Adaptive preview is a debugging tool used for testing the window contents at specific screen sizes, simulating mobile environment.

Adaptive preview can always be accessed from inspector. This function allows applications to open it manually.

Most applications should not use this function.

Added in version 1.7.

Parameters:

adaptive_preview – whether to open adaptive preview

set_content(content: Widget | None = None) None#

Sets the content widget of self.

This method should always be used instead of set_child.

Parameters:

content – the content widget

Properties#

class ApplicationWindow
props.adaptive_preview: bool#

Whether adaptive preview is currently open.

Adaptive preview is a debugging tool used for testing the window contents at specific screen sizes, simulating mobile environment.

Adaptive preview can always be accessed from inspector. This function allows applications to open it manually.

Most applications should not use this property.

Added in version 1.7.

props.content: Widget#

The content widget.

This property should always be used instead of child.

props.current_breakpoint: Breakpoint#

The current breakpoint.

Added in version 1.4.

props.dialogs: ListModel#

The open dialogs.

Added in version 1.5.

props.visible_dialog: Dialog#

The currently visible dialog

Added in version 1.5.

Fields#

class ApplicationWindow
parent_instance#