Adw.TabPage

g Adw.TabPage Adw.TabPage GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible GObject.Object GObject.Object GObject.Object->Adw.TabPage Gtk.Accessible->Adw.TabPage

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gtk.Accessible (15)

Structs:

GObject.ObjectClass (5)

get_child ()

get_icon ()

get_indicator_activatable ()

get_indicator_icon ()

get_indicator_tooltip ()

get_keyword ()

get_live_thumbnail ()

get_loading ()

get_needs_attention ()

get_parent ()

get_pinned ()

get_selected ()

get_thumbnail_xalign ()

get_thumbnail_yalign ()

get_title ()

get_tooltip ()

invalidate_thumbnail ()

set_icon (icon)

set_indicator_activatable (activatable)

set_indicator_icon (indicator_icon)

set_indicator_tooltip (tooltip)

set_keyword (keyword)

set_live_thumbnail (live_thumbnail)

set_loading (loading)

set_needs_attention (needs_attention)

set_thumbnail_xalign (xalign)

set_thumbnail_yalign (yalign)

set_title (title)

set_tooltip (tooltip)

Virtual Methods

Inherited:

GObject.Object (7), Gtk.Accessible (6)

Properties

Inherited:

Gtk.Accessible (1)

Name

Type

Flags

Short Description

child

Gtk.Widget

r/w/co

icon

Gio.Icon

r/w/en

indicator-activatable

bool

r/w/en

indicator-icon

Gio.Icon

r/w/en

indicator-tooltip

str

r/w/en

keyword

str

r/w/en

live-thumbnail

bool

r/w/en

loading

bool

r/w/en

needs-attention

bool

r/w/en

parent

Adw.TabPage

r/w/co/en

pinned

bool

r

selected

bool

r

thumbnail-xalign

float

r/w/en

thumbnail-yalign

float

r/w/en

title

str

r/w/en

tooltip

str

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Adw.TabPage(**kwargs)
Bases:

GObject.Object, Gtk.Accessible

Abstract:

No

Structure:

Adw.TabPageClass

An auxiliary class used by [class`TabView`].

get_child()
Returns:

the child of self

Return type:

Gtk.Widget

Gets the child of self.

get_icon()
Returns:

the icon of self

Return type:

Gio.Icon or None

Gets the icon of self.

get_indicator_activatable()
Returns:

whether the indicator is activatable

Return type:

bool

Gets whether the indicator of self is activatable.

get_indicator_icon()
Returns:

the indicator icon of self

Return type:

Gio.Icon or None

Gets the indicator icon of self.

get_indicator_tooltip()
Returns:

the indicator tooltip of self

Return type:

str

Gets the tooltip of the indicator icon of self.

New in version 1.2.

get_keyword()
Returns:

the search keyword of self

Return type:

str or None

Gets the search keyword of self.

New in version 1.3.

get_live_thumbnail()
Returns:

whether live thumbnail is enabled

Return type:

bool

Gets whether to live thumbnail is enabled self.

New in version 1.3.

get_loading()
Returns:

whether self is loading

Return type:

bool

Gets whether self is loading.

get_needs_attention()
Returns:

whether self needs attention

Return type:

bool

Gets whether self needs attention.

get_parent()
Returns:

the parent page

Return type:

Adw.TabPage or None

Gets the parent page of self.

See [method`TabView`.add_page] and [method`TabView`.close_page].

get_pinned()
Returns:

whether self is pinned

Return type:

bool

Gets whether self is pinned.

See [method`TabView`.set_page_pinned].

get_selected()
Returns:

whether self is selected

Return type:

bool

Gets whether self is selected.

get_thumbnail_xalign()
Returns:

the horizontal alignment

Return type:

float

Gets the horizontal alignment of the thumbnail for self.

New in version 1.3.

get_thumbnail_yalign()
Returns:

the vertical alignment

Return type:

float

Gets the vertical alignment of the thumbnail for self.

New in version 1.3.

get_title()
Returns:

the title of self

Return type:

str

Gets the title of self.

get_tooltip()
Returns:

the tooltip of self

Return type:

str or None

Gets the tooltip of self.

invalidate_thumbnail()

Invalidates thumbnail for self.

If an [class`TabOverview`] is open, the thumbnail representing self will be immediately updated. Otherwise it will be update when opening the overview.

Does nothing if [property`TabPage`:py:data::live-thumbnail<Adw.TabPage.props.live_thumbnail>] is set to TRUE.

See also [method`TabView`.invalidate_thumbnails].

New in version 1.3.

set_icon(icon)
Parameters:

icon (Gio.Icon or None) – the icon of self

Sets the icon of self.

[class`TabBar`] and [class`TabOverview`] display the icon next to the title, unless [property`TabPage`:py:data::loading<Adw.TabPage.props.loading>] is set to TRUE.

AdwTabBar also won’t show the icon if the page is pinned and [propertyTabPage:indicator-icon] is set.

set_indicator_activatable(activatable)
Parameters:

activatable (bool) – whether the indicator is activatable

Sets whether the indicator of self is activatable.

If set to TRUE, [signal`TabView`:py:func:::indicator-activated<Adw.TabPage.signals.indicator_activated>] will be emitted when the indicator icon is clicked.

If [property`TabPage`:py:data::indicator-icon<Adw.TabPage.props.indicator_icon>] is not set, does nothing.

set_indicator_icon(indicator_icon)
Parameters:

indicator_icon (Gio.Icon or None) – the indicator icon of self

Sets the indicator icon of self.

A common use case is an audio or camera indicator in a web browser.

[class`TabBar`] will show it at the beginning of the tab, alongside icon representing [property`TabPage`:py:data::icon<Adw.TabPage.props.icon>] or loading spinner.

If the page is pinned, the indicator will be shown instead of icon or spinner.

[class`TabOverview`] will show it at the at the top part of the thumbnail.

[property`TabPage`:py:data::indicator-tooltip<Adw.TabPage.props.indicator_tooltip>] can be used to set the tooltip on the indicator icon.

If [property`TabPage`:py:data::indicator-activatable<Adw.TabPage.props.indicator_activatable>] is set to TRUE, the indicator icon can act as a button.

set_indicator_tooltip(tooltip)
Parameters:

tooltip (str) – the indicator tooltip of self

Sets the tooltip of the indicator icon of self.

The tooltip can be marked up with the Pango text markup language.

See [property`TabPage`:py:data::indicator-icon<Adw.TabPage.props.indicator_icon>].

New in version 1.2.

set_keyword(keyword)
Parameters:

keyword (str) – the search keyword

Sets the search keyword for self.

[class`TabOverview`] can search pages by their keywords in addition to their titles and tooltips.

Keywords allow to include e.g. page URLs into tab search in a web browser.

New in version 1.3.

set_live_thumbnail(live_thumbnail)
Parameters:

live_thumbnail (bool) – whether to enable live thumbnail

Sets whether to enable live thumbnail for self.

When set to TRUE, self's thumbnail in [class`TabOverview`] will update immediately when self is redrawn or resized.

If it’s set to FALSE, the thumbnail will only be live when the self is selected, and otherwise it will be static and will only update when [method`TabPage`.invalidate_thumbnail] or [method`TabView`.invalidate_thumbnails] is called.

New in version 1.3.

set_loading(loading)
Parameters:

loading (bool) – whether self is loading

Sets whether self is loading.

If set to TRUE, [class`TabBar`] and [class`TabOverview`] will display a spinner in place of icon.

If the page is pinned and [property`TabPage`:py:data::indicator-icon<Adw.TabPage.props.indicator_icon>] is set, loading status will not be visible with AdwTabBar.

set_needs_attention(needs_attention)
Parameters:

needs_attention (bool) – whether self needs attention

Sets whether self needs attention.

[class`TabBar`] will display a line under the tab representing the page if set to TRUE. If the tab is not visible, the corresponding edge of the tab bar will be highlighted.

[class`TabOverview`] will display a dot in the corner of the thumbnail if set to TRUE.

[class`TabButton`] will display a dot if any of the pages that aren’t selected have [property`TabPage`:py:data::needs-attention<Adw.TabPage.props.needs_attention>] set to TRUE.

set_thumbnail_xalign(xalign)
Parameters:

xalign (float) – the new value

Sets the horizontal alignment of the thumbnail for self.

If the page is so wide that [class`TabOverview`] can’t display it completely and has to crop it, horizontal alignment will determine which part of the page will be visible.

For example, 0.5 means the center of the page will be visible, 0 means the start edge will be visible and 1 means the end edge will be visible.

The default horizontal alignment is 0.

New in version 1.3.

set_thumbnail_yalign(yalign)
Parameters:

yalign (float) – the new value

Sets the vertical alignment of the thumbnail for self.

If the page is so tall that [class`TabOverview`] can’t display it completely and has to crop it, vertical alignment will determine which part of the page will be visible.

For example, 0.5 means the center of the page will be visible, 0 means the top edge will be visible and 1 means the bottom edge will be visible.

The default vertical alignment is 0.

New in version 1.3.

set_title(title)
Parameters:

title (str) – the title of self

[class`TabBar`] will display it in the center of the tab unless it’s pinned, and will use it as a tooltip unless [property`TabPage`:py:data::tooltip<Adw.TabPage.props.tooltip>] is set.

[class`TabOverview`] will display it below the thumbnail unless it’s pinned, or inside the card otherwise, and will use it as a tooltip unless [property`TabPage`:py:data::tooltip<Adw.TabPage.props.tooltip>] is set.

Sets the title of self.

set_tooltip(tooltip)
Parameters:

tooltip (str) – the tooltip of self

Sets the tooltip of self.

The tooltip can be marked up with the Pango text markup language.

If not set, [class`TabBar`] and [class`TabOverview`] will use [property`TabPage`:py:data::title<Adw.TabPage.props.title>] as a tooltip instead.

Property Details

Adw.TabPage.props.child
Name:

child

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The child of the page.

Adw.TabPage.props.icon
Name:

icon

Type:

Gio.Icon

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The icon of the page.

[class`TabBar`] and [class`TabOverview`] display the icon next to the title, unless [property`TabPage`:py:data::loading<Adw.TabPage.props.loading>] is set to TRUE.

AdwTabBar also won’t show the icon if the page is pinned and [propertyTabPage:indicator-icon] is set.

Adw.TabPage.props.indicator_activatable
Name:

indicator-activatable

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the indicator icon is activatable.

If set to TRUE, [signal`TabView`:py:func:::indicator-activated<Adw.TabPage.signals.indicator_activated>] will be emitted when the indicator icon is clicked.

If [property`TabPage`:py:data::indicator-icon<Adw.TabPage.props.indicator_icon>] is not set, does nothing.

Adw.TabPage.props.indicator_icon
Name:

indicator-icon

Type:

Gio.Icon

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

An indicator icon for the page.

A common use case is an audio or camera indicator in a web browser.

[class`TabBar`] will show it at the beginning of the tab, alongside icon representing [property`TabPage`:py:data::icon<Adw.TabPage.props.icon>] or loading spinner.

If the page is pinned, the indicator will be shown instead of icon or spinner.

[class`TabOverview`] will show it at the at the top part of the thumbnail.

[property`TabPage`:py:data::indicator-tooltip<Adw.TabPage.props.indicator_tooltip>] can be used to set the tooltip on the indicator icon.

If [property`TabPage`:py:data::indicator-activatable<Adw.TabPage.props.indicator_activatable>] is set to TRUE, the indicator icon can act as a button.

Adw.TabPage.props.indicator_tooltip
Name:

indicator-tooltip

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The tooltip of the indicator icon.

The tooltip can be marked up with the Pango text markup language.

See [property`TabPage`:py:data::indicator-icon<Adw.TabPage.props.indicator_icon>].

New in version 1.2.

Adw.TabPage.props.keyword
Name:

keyword

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The search keyboard of the page.

[class`TabOverview`] can search pages by their keywords in addition to their titles and tooltips.

Keywords allow to include e.g. page URLs into tab search in a web browser.

New in version 1.3.

Adw.TabPage.props.live_thumbnail
Name:

live-thumbnail

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether to enable live thumbnail for this page.

When set to TRUE, the page’s thumbnail in [class`TabOverview`] will update immediately when the page is redrawn or resized.

If it’s set to FALSE, the thumbnail will only be live when the page is selected, and otherwise it will be static and will only update when [method`TabPage`.invalidate_thumbnail] or [method`TabView`.invalidate_thumbnails] is called.

New in version 1.3.

Adw.TabPage.props.loading
Name:

loading

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the page is loading.

If set to TRUE, [class`TabBar`] and [class`TabOverview`] will display a spinner in place of icon.

If the page is pinned and [property`TabPage`:py:data::indicator-icon<Adw.TabPage.props.indicator_icon>] is set, loading status will not be visible with AdwTabBar.

Adw.TabPage.props.needs_attention
Name:

needs-attention

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the page needs attention.

[class`TabBar`] will display a line under the tab representing the page if set to TRUE. If the tab is not visible, the corresponding edge of the tab bar will be highlighted.

[class`TabOverview`] will display a dot in the corner of the thumbnail if set to TRUE.

[class`TabButton`] will display a dot if any of the pages that aren’t selected have this property set to TRUE.

Adw.TabPage.props.parent
Name:

parent

Type:

Adw.TabPage

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY, EXPLICIT_NOTIFY

The parent page of the page.

See [method`TabView`.add_page] and [method`TabView`.close_page].

Adw.TabPage.props.pinned
Name:

pinned

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the page is pinned.

See [method`TabView`.set_page_pinned].

Adw.TabPage.props.selected
Name:

selected

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the page is selected.

Adw.TabPage.props.thumbnail_xalign
Name:

thumbnail-xalign

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The horizontal alignment of the page thumbnail.

If the page is so wide that [class`TabOverview`] can’t display it completely and has to crop it, horizontal alignment will determine which part of the page will be visible.

For example, 0.5 means the center of the page will be visible, 0 means the start edge will be visible and 1 means the end edge will be visible.

The default horizontal alignment is 0.

New in version 1.3.

Adw.TabPage.props.thumbnail_yalign
Name:

thumbnail-yalign

Type:

float

Default Value:

0.0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The vertical alignment of the page thumbnail.

If the page is so tall that [class`TabOverview`] can’t display it completely and has to crop it, vertical alignment will determine which part of the page will be visible.

For example, 0.5 means the center of the page will be visible, 0 means the top edge will be visible and 1 means the bottom edge will be visible.

The default vertical alignment is 0.

New in version 1.3.

Adw.TabPage.props.title
Name:

title

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The title of the page.

[class`TabBar`] will display it in the center of the tab unless it’s pinned, and will use it as a tooltip unless [property`TabPage`:py:data::tooltip<Adw.TabPage.props.tooltip>] is set.

[class`TabOverview`] will display it below the thumbnail unless it’s pinned, or inside the card otherwise, and will use it as a tooltip unless [property`TabPage`:py:data::tooltip<Adw.TabPage.props.tooltip>] is set.

Adw.TabPage.props.tooltip
Name:

tooltip

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The tooltip of the page.

The tooltip can be marked up with the Pango text markup language.

If not set, [class`TabBar`] and [class`TabOverview`] will use [property`TabPage`:py:data::title<Adw.TabPage.props.title>] as a tooltip instead.