Adw.TabButton

g Adw.TabButton Adw.TabButton GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget 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.Actionable->Adw.TabButton Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Widget->Adw.TabButton

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Actionable (5)

Structs:

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

class

new ()

get_view ()

set_view (view)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.Actionable (4)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1), Gtk.Actionable (2)

Name

Type

Flags

Short Description

view

Adw.TabView

r/w/en

Signals

Inherited:

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

Name

Short Description

activate

Emitted to animate press then release.

clicked

Emitted when the button has been activated (pressed and released).

Fields

Inherited:

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

Class Details

class Adw.TabButton(**kwargs)
Bases:

Gtk.Widget, Gtk.Actionable

Abstract:

No

Structure:

Adw.TabButtonClass

A button that displays the number of [class`TabView`] pages.

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

AdwTabButton is a button that displays the number of pages in a given AdwTabView, as well as whether one of the inactive pages needs attention.

It’s intended to be used as a visible indicator when there’s no visible tab bar, typically opening an [class`TabOverview`] on click, e.g. via the overview.open action name:

``xml <object class=”AdwTabButton”>

<property name=”view”>view</property> <property name=”action-name”>overview.open</property>

</object> ``

CSS nodes

AdwTabButton has a main CSS node with name tabbutton.

Accessibility

AdwTabButton uses the GTK_ACCESSIBLE_ROLE_BUTTON role.

New in version 1.3.

classmethod new()
Returns:

the newly created AdwTabButton

Return type:

Gtk.Widget

Creates a new AdwTabButton.

New in version 1.3.

get_view()
Returns:

the tab view

Return type:

Adw.TabView or None

Gets the tab view self displays.

New in version 1.3.

set_view(view)
Parameters:

view (Adw.TabView or None) – a tab view

Sets the tab view to display.

New in version 1.3.

Signal Details

Adw.TabButton.signals.activate(tab_button)
Signal Name:

activate

Flags:

RUN_FIRST, ACTION

Parameters:

tab_button (Adw.TabButton) – The object which received the signal

Emitted to animate press then release.

This is an action signal. Applications should never connect to this signal, but use the [signal`TabButton`:py:func:::clicked<Adw.TabButton.signals.clicked>] signal.

New in version 1.3.

Adw.TabButton.signals.clicked(tab_button)
Signal Name:

clicked

Flags:

RUN_FIRST, ACTION

Parameters:

tab_button (Adw.TabButton) – The object which received the signal

Emitted when the button has been activated (pressed and released).

New in version 1.3.

Property Details

Adw.TabButton.props.view
Name:

view

Type:

Adw.TabView

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The view the tab button displays.

New in version 1.3.