Notebook
open class Notebook : Widget, NotebookProtocol
GtkNotebook is a container whose children are pages switched
between using tabs.

There are many configuration options for GtkNotebook. Among
other things, you can choose on which edge the tabs appear
(see [methodGtk.Notebook.set_tab_pos]), whether, if there are
too many tabs to fit the notebook should be made bigger or scrolling
arrows added (see [methodGtk.Notebook.set_scrollable]), and whether
there will be a popup menu allowing the users to switch pages.
(see [methodGtk.Notebook.popup_enable]).
GtkNotebook as GtkBuildable
The GtkNotebook implementation of the GtkBuildable interface
supports placing children into tabs by specifying “tab” as the
“type” attribute of a <child> element. Note that the content
of the tab must be created before the tab can be filled.
A tab child can be specified without specifying a <child>
type attribute.
To add a child widget in the notebooks action area, specify “action-start” or “action-end” as the “type” attribute of the <child> element.
An example of a UI definition fragment with GtkNotebook:
<object class="GtkNotebook">
<child>
<object class="GtkLabel" id="notebook-content">
<property name="label">Content</property>
</object>
</child>
<child type="tab">
<object class="GtkLabel" id="notebook-tab">
<property name="label">Tab</property>
</object>
</child>
</object>
CSS nodes
notebook
├── header.top
│ ├── [<action widget>]
│ ├── tabs
│ │ ├── [arrow]
│ │ ├── tab
│ │ │ ╰── <tab label>
┊ ┊ ┊
│ │ ├── tab[.reorderable-page]
│ │ │ ╰── <tab label>
│ │ ╰── [arrow]
│ ╰── [<action widget>]
│
╰── stack
├── <child>
┊
╰── <child>
GtkNotebook has a main CSS node with name notebook, a subnode
with name header and below that a subnode with name tabs which
contains one subnode per tab with name tab.
If action widgets are present, their CSS nodes are placed next
to the tabs node. If the notebook is scrollable, CSS nodes with
name arrow are placed as first and last child of the tabs node.
The main node gets the .frame style class when the notebook
has a border (see [methodGtk.Notebook.set_show_border]).
The header node gets one of the style class .top, .bottom,
.left or .right, depending on where the tabs are placed. For
reorderable pages, the tab node gets the .reorderable-page class.
A tab node gets the .dnd style class while it is moved with drag-and-drop.
The nodes are always arranged from left-to-right, regardless of text direction.
Accessibility
GtkNotebook uses the following roles:
GTK_ACCESSIBLE_ROLE_GROUPfor the notebook widgetGTK_ACCESSIBLE_ROLE_TAB_LISTfor the list of tabsGTK_ACCESSIBLE_ROLE_TABrole for each tabGTK_ACCESSIBLE_ROLE_TAB_PANELfor each page
The Notebook type acts as a reference-counted owner of an underlying GtkNotebook instance.
It provides the methods that can operate on this data type through NotebookProtocol conformance.
Use Notebook as a strong reference or owner of a GtkNotebook instance.
-
Designated initialiser from the underlying `C` data type.This creates an instance without performing an unbalanced retain i.e., ownership is transferred to the
Notebookinstance.Declaration
Swift
@inlinable public init(_ op: UnsafeMutablePointer<GtkNotebook>)Parameters
oppointer to the underlying object
-
Designated initialiser from a constant pointer to the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theNotebookinstance.Declaration
Swift
@inlinable public init(_ op: UnsafePointer<GtkNotebook>)Parameters
oppointer to the underlying object
-
Optional initialiser from a non-mutating
gpointerto the underlyingCdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theNotebookinstance.Declaration
Swift
@inlinable override public init!(gpointer op: gpointer?)Parameters
opgpointer to the underlying object
-
Optional initialiser from a non-mutating
gconstpointerto the underlyingCdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theNotebookinstance.Declaration
Swift
@inlinable override public init!(gconstpointer op: gconstpointer?)Parameters
oppointer to the underlying object
-
Optional initialiser from a constant pointer to the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theNotebookinstance.Declaration
Swift
@inlinable public init!(_ op: UnsafePointer<GtkNotebook>?)Parameters
oppointer to the underlying object
-
Optional initialiser from the underlying
Cdata type. This creates an instance without performing an unbalanced retain i.e., ownership is transferred to theNotebookinstance.Declaration
Swift
@inlinable public init!(_ op: UnsafeMutablePointer<GtkNotebook>?)Parameters
oppointer to the underlying object
-
Designated initialiser from the underlying
Cdata type. Will retainGtkNotebook. i.e., ownership is transferred to theNotebookinstance.Declaration
Swift
@inlinable public init(retaining op: UnsafeMutablePointer<GtkNotebook>)Parameters
oppointer to the underlying object
-
Reference intialiser for a related type that implements
NotebookProtocolWill retainGtkNotebook.Declaration
Swift
@inlinable public init<T>(notebook other: T) where T : NotebookProtocolParameters
otheran instance of a related type that implements
NotebookProtocol -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
NotebookProtocol.Declaration
Swift
@inlinable override public init<T>(cPointer p: UnsafeMutablePointer<T>)Parameters
cPointerpointer to the underlying object
-
Unsafe typed, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
NotebookProtocol.Declaration
Swift
@inlinable override public init<T>(retainingCPointer cPointer: UnsafeMutablePointer<T>)Parameters
cPointerpointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
NotebookProtocol.Declaration
Swift
@inlinable override public init(raw p: UnsafeRawPointer)Parameters
praw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
NotebookProtocol.Declaration
Swift
@inlinable override public init(retainingRaw raw: UnsafeRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
NotebookProtocol.Declaration
Swift
@inlinable public required init(raw p: UnsafeMutableRawPointer)Parameters
pmutable raw pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
NotebookProtocol.Declaration
Swift
@inlinable required public init(retainingRaw raw: UnsafeMutableRawPointer)Parameters
rawmutable raw pointer to the underlying object
-
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
NotebookProtocol.Declaration
Swift
@inlinable override public init(opaquePointer p: OpaquePointer)Parameters
popaque pointer to the underlying object
-
Unsafe untyped, retaining initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
NotebookProtocol.Declaration
Swift
@inlinable override public init(retainingOpaquePointer p: OpaquePointer)Parameters
popaque pointer to the underlying object
-
Creates a new
GtkNotebookwidget with no pages.Declaration
Swift
@inlinable public init()
View on GitHub
Install in Dash
Notebook Class Reference