Adw.Window¶
- Subclasses:
Methods¶
- Inherited:
Gtk.Window (62), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Native (6), Gtk.Root (3)
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r |
|||
r |
|||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Adw.Window(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
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
orNone
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:
Gets the current breakpoint.
New in version 1.4.
- get_dialogs()¶
- Returns:
a list model for the dialogs of self
- Return type:
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
orNone
Returns the currently visible dialog in self, if there’s one.
New in version 1.5.
- set_content(content)¶
- Parameters:
content (
Gtk.Widget
orNone
) – 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:
- Default Value:
- Flags:
The content widget.
This property should always be used instead of [property`Gtk`.Window:child].
- Adw.Window.props.current_breakpoint¶
- Name:
current-breakpoint
- Type:
- Default Value:
- Flags:
The current breakpoint.
New in version 1.4.
- Adw.Window.props.dialogs¶
- Name:
dialogs
- Type:
- Default Value:
- Flags:
The open dialogs.
New in version 1.5.
- Adw.Window.props.visible_dialog¶
- Name:
visible-dialog
- Type:
- Default Value:
- Flags:
The currently visible dialog
New in version 1.5.