adw.window

Module for Window class

Types 3

A freeform window.

window

The adw.window.Window widget is a subclass of gtk.window.Window which has no titlebar area. Instead, adw.toolbar_view.ToolbarView can be used together with adw.header_bar.HeaderBar or gtk.header_bar.HeaderBar as follows:

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

Using gtk.window.Window.titlebar or gtk.window.Window.child is not supported and will result in a crash. Use adw.window.Window.content instead.

Dialogs

adw.window.Window can contain adw.dialog.Dialog. Use adw.dialog.Dialog.present with the window or a widget within a window to show a dialog.

Breakpoints

adw.window.Window can be used with adw.breakpoint.Breakpoint the same way as adw.breakpoint_bin.BreakpointBin. Refer to that widget's documentation for details.

Example:

<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 adw.breakpoint_bin.BreakpointBin, if breakpoints are used, adw.window.Window doesn't have a minimum size, and gtk.widget.Widget.widthRequest and gtk.widget.Widget.heightRequest properties must be set manually.

Methods
GType _gType() @property
Window self()Returns `this`, for use in `with` statements.
WindowGidBuilder builder()Get builder for [adw.window.Window] Returns: New builder object
gtk.widget.Widget content() @propertyGet `content` property. Returns: The content widget.
void content(gtk.widget.Widget propval) @propertySet `content` property. Params: propval = The content widget.
adw.breakpoint.Breakpoint currentBreakpoint() @propertyGet `currentBreakpoint` property. Returns: The current breakpoint.
gio.list_model.ListModel dialogs() @propertyGet `dialogs` property. Returns: The open dialogs.
adw.dialog.Dialog visibleDialog() @propertyGet `visibleDialog` property. Returns: The currently visible dialog
void addBreakpoint(adw.breakpoint.Breakpoint breakpoint)Adds breakpoint to self.
gtk.widget.Widget getContent()Gets the content widget of self.
adw.breakpoint.Breakpoint getCurrentBreakpoint()Gets the current breakpoint. Returns: the current breakpoint
gio.list_model.ListModel getDialogs()Returns a [gio.list_model.ListModel] that contains the open dialogs of self.
adw.dialog.Dialog getVisibleDialog()Returns the currently visible dialog in self, if there's one. Returns: the visible dialog
void setContent(gtk.widget.Widget content = null)Sets the content widget of self.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [adw.window.Window]. Returns: the newly created [adw.window.Window]

Fluent builder implementation template for adw.window.Window

Methods
T content(gtk.widget.Widget propval)Set `content` property. Params: propval = The content widget.

Fluent builder for adw.window.Window

Methods
Window build()Create object from builder. Returns: New object