TabView

class TabView(pointer: <Error class: unknown class><<Error class: unknown class>>)

A dynamic tabbed container.

AdwTabView is a container which shows one child at a time. While it provides keyboard shortcuts for switching between pages, it does not provide a visible tab switcher and relies on external widgets for that, such as class@TabBar, class@TabOverview and class@TabButton.

AdwTabView maintains a class@TabPage object for each page, which holds additional per-page properties. You can obtain the AdwTabPage for a page with method@TabView.get_page, and as the return value for method@TabView.append and other functions for adding children.

AdwTabView only aims to be useful for dynamic tabs in multi-window document-based applications, such as web browsers, file managers, text editors or terminals. It does not aim to replace class@Gtk.Notebook for use cases such as tabbed dialogs.

As such, it does not support disabling page reordering or detaching.

AdwTabView adds a number of global page switching and reordering shortcuts. The property@TabView:shortcuts property can be used to manage them.

See flags@TabViewShortcuts for the list of the available shortcuts. All of the shortcuts are enabled by default.

method@TabView.add_shortcuts and method@TabView.remove_shortcuts can be used to manage shortcuts in a convenient way, for example:

adw_tab_view_remove_shortcuts (view, ADW_TAB_VIEW_SHORTCUT_CONTROL_HOME |
ADW_TAB_VIEW_SHORTCUT_CONTROL_END);

CSS nodes

AdwTabView has a main CSS node with the name tabview.

Accessibility

AdwTabView uses the GTK_ACCESSIBLE_ROLE_TAB_PANEL for the tab pages which are the accessible parent objects of the child widgets.

Skipped during bindings generation

  • method selected-page: Property TypeInfo of getter and setter do not match

Constructors

Link copied to clipboard
constructor()

Creates a new AdwTabView.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val adwTabViewPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
var defaultIcon: <Error class: unknown class>

Default page icon.

Link copied to clipboard
open val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Whether a page is being transferred.

Link copied to clipboard
var menuModel: <Error class: unknown class>?

Tab context menu model.

Link copied to clipboard
val nPages: Int

The number of pages in the tab view.

Link copied to clipboard

The number of pinned pages in the tab view.

Link copied to clipboard
val pages: <Error class: unknown class>

A selection model with the tab view's pages.

Link copied to clipboard

The enabled shortcuts.

Functions

Link copied to clipboard
fun addPage(child: <Error class: unknown class>, parent: TabPage? = null): TabPage

Adds @child to @self with @parent as the parent.

Link copied to clipboard

Adds @shortcuts for @self.

Link copied to clipboard
fun append(child: <Error class: unknown class>): TabPage

Inserts @child as the last non-pinned page.

Link copied to clipboard
fun appendPinned(child: <Error class: unknown class>): TabPage

Inserts @child as the last pinned page.

Link copied to clipboard

Requests to close all pages other than @page.

Link copied to clipboard
fun closePage(page: TabPage)

Requests to close @page.

Link copied to clipboard
fun closePageFinish(page: TabPage, confirm: Boolean)

Completes a method@TabView.close_page call for @page.

Link copied to clipboard

Requests to close all pages after @page.

Link copied to clipboard

Requests to close all pages before @page.

Link copied to clipboard
fun connectClosePage(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (page: TabPage) -> Boolean): <Error class: unknown class>

Emitted after method@TabView.close_page has been called for @page.

Link copied to clipboard
fun connectCreateWindow(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: () -> TabView?): <Error class: unknown class>

Emitted when a tab should be transferred into a new window.

Link copied to clipboard
fun connectIndicatorActivated(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (page: TabPage) -> Unit): <Error class: unknown class>

Emitted after the indicator icon on @page has been activated.

Link copied to clipboard
fun connectPageAttached(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (page: TabPage, position: Int) -> Unit): <Error class: unknown class>

Emitted when a page has been created or transferred to @self.

Link copied to clipboard
fun connectPageDetached(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (page: TabPage, position: Int) -> Unit): <Error class: unknown class>

Emitted when a page has been removed or transferred to another view.

Link copied to clipboard
fun connectPageReordered(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (page: TabPage, position: Int) -> Unit): <Error class: unknown class>

Emitted after @page has been reordered to @position.

Link copied to clipboard
fun connectSetupMenu(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (page: TabPage?) -> Unit): <Error class: unknown class>

Emitted when a context menu is opened or closed for @page.

Link copied to clipboard
fun getDefaultIcon(): <Error class: unknown class>

Gets the default icon of @self.

Link copied to clipboard

Whether a page is being transferred.

Link copied to clipboard
fun getMenuModel(): <Error class: unknown class>?

Gets the tab context menu model for @self.

Link copied to clipboard
fun getNPages(): Int

Gets the number of pages in @self.

Link copied to clipboard

Gets the number of pinned pages in @self.

Link copied to clipboard
fun getNthPage(position: Int): TabPage

Gets the class@TabPage representing the child at @position.

Link copied to clipboard
fun getPage(child: <Error class: unknown class>): TabPage

Gets the class@TabPage object representing @child.

Link copied to clipboard

Finds the position of @page in @self, starting from 0.

Link copied to clipboard
fun getPages(): <Error class: unknown class>

Returns a iface@Gio.ListModel that contains the pages of @self.

Link copied to clipboard

Gets the currently selected page in @self.

Link copied to clipboard

Gets the enabled shortcuts for @self.

Link copied to clipboard
fun insert(child: <Error class: unknown class>, position: Int): TabPage

Inserts a non-pinned page at @position.

Link copied to clipboard
fun insertPinned(child: <Error class: unknown class>, position: Int): TabPage

Inserts a pinned page at @position.

Link copied to clipboard

Invalidates thumbnails for all pages in @self.

Link copied to clipboard
fun prepend(child: <Error class: unknown class>): TabPage

Inserts @child as the first non-pinned page.

Link copied to clipboard
fun prependPinned(child: <Error class: unknown class>): TabPage

Inserts @child as the first pinned page.

Link copied to clipboard

Removes @shortcuts from @self.

Link copied to clipboard

Reorders @page to before its previous page if possible.

Link copied to clipboard

Reorders @page to the first possible position.

Link copied to clipboard

Reorders @page to after its next page if possible.

Link copied to clipboard

Reorders @page to the last possible position.

Link copied to clipboard
fun reorderPage(page: TabPage, position: Int): Boolean

Reorders @page to @position.

Link copied to clipboard

Selects the page after the currently selected page.

Link copied to clipboard

Selects the page before the currently selected page.

Link copied to clipboard
fun setDefaultIcon(defaultIcon: <Error class: unknown class>)

Sets the default page icon for @self.

Link copied to clipboard
fun setMenuModel(menuModel: <Error class: unknown class>? = null)

Sets the tab context menu model for @self.

Link copied to clipboard
fun setPagePinned(page: TabPage, pinned: Boolean)

Pins or unpins @page.

Link copied to clipboard
fun setSelectedPage(selectedPage: TabPage)

Sets the currently selected page in @self.

Link copied to clipboard

Sets the enabled shortcuts for @self.

Link copied to clipboard
fun transferPage(page: TabPage, otherView: TabView, position: Int)

Transfers @page from @self to @other_view.