NotebookProtocol
public protocol NotebookProtocol : ContainerProtocol
The GtkNotebook
widget is a GtkContainer
whose children are pages that
can be switched between using tab labels along one edge.
There are many configuration options for GtkNotebook. Among other
things, you can choose on which edge the tabs appear
(see gtk_notebook_set_tab_pos()
), whether, if there are too many
tabs to fit the notebook should be made bigger or scrolling
arrows added (see gtk_notebook_set_scrollable()
), and whether there
will be a popup menu allowing the users to switch pages.
(see gtk_notebook_popup_enable()
, gtk_notebook_popup_disable()
)
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
(plain Language Example):
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 gtk_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, regarldess of text direction.
The NotebookProtocol
protocol exposes the methods and properties of an underlying GtkNotebook
instance.
The default implementation of these can be found in the protocol extension below.
For a concrete class that implements these methods and properties, see Notebook
.
Alternatively, use NotebookRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkNotebook
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
notebook_ptr
Default implementationTyped pointer to the underlying
GtkNotebook
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkNotebook
instance.Declaration
Swift
var notebook_ptr: UnsafeMutablePointer<GtkNotebook>! { get }
-
Required Initialiser for types conforming to
NotebookProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
NotebookPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: NotebookPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol
Parameters
source_property
the source property to bind
target
the target object to bind to
target_property
the target property to bind to
flags
the flags to pass to the
Binding
transform_from
ValueTransformer
to use for forward transformationtransform_to
ValueTransformer
to use for backwards transformationReturn Value
binding reference or
nil
in case of an error -
get(property:
Extension method) Get the value of a Notebook property
Declaration
Swift
@inlinable func get(property: NotebookPropertyName) -> GLibObject.Value
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
set(property:
Extension methodvalue: ) Set the value of a Notebook property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: NotebookPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
NotebookSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: NotebookSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
handler
The Swift signal handler (function or callback) to invoke on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
connect(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
NotebookSignalName
signalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: NotebookSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int
Parameters
signal
The signal to connect
flags
The connection flags to use
data
A pointer to user data to provide to the callback
destroyData
A
GClosureNotify
C function to destroy the data pointed to byuserData
signalHandler
The C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
createWindowSignal
Extension methodThe
create-window
signal is emitted when a detachable tab is dropped on the root window.A handler for this signal can create a window containing a notebook where the tab will be attached. It is also responsible for moving/resizing the window and adding the necessary properties to the notebook (e.g. the
GtkNotebook:group-name
).Note
This represents the underlyingcreate-window
signalWarning
aonCreateWindow
wrapper for this signal could not be generated because it contains unimplemented features: { (9) Record return type is not yet supported }Note
Instead, you can connectcreateWindowSignal
using theconnect(signal:)
methodsDeclaration
Swift
static var createWindowSignal: NotebookSignalName { get }
Parameters
flags
Flags
unownedSelf
Reference to instance of self
page
the tab of
notebook
that is being detachedx
the X coordinate where the drop happens
y
the Y coordinate where the drop happens
handler
a
GtkNotebook
thatpage
should be added to, ornil
. -
onChangeCurrentPage(flags:
Extension methodhandler: ) Note
This represents the underlyingchange-current-page
signalDeclaration
Swift
@discardableResult @inlinable func onChangeCurrentPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ object: Int) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
object
none
handler
The signal handler to call Run the given callback whenever the
changeCurrentPage
signal is emitted -
changeCurrentPageSignal
Extension methodTyped
change-current-page
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var changeCurrentPageSignal: NotebookSignalName { get }
-
onFocusTab(flags:
Extension methodhandler: ) Note
This represents the underlyingfocus-tab
signalDeclaration
Swift
@discardableResult @inlinable func onFocusTab(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ object: NotebookTab) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
object
none
handler
The signal handler to call Run the given callback whenever the
focusTab
signal is emitted -
focusTabSignal
Extension methodTyped
focus-tab
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var focusTabSignal: NotebookSignalName { get }
-
onMoveFocusOut(flags:
Extension methodhandler: ) Note
This represents the underlyingmove-focus-out
signalDeclaration
Swift
@discardableResult @inlinable func onMoveFocusOut(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ object: DirectionType) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
object
none
handler
The signal handler to call Run the given callback whenever the
moveFocusOut
signal is emitted -
moveFocusOutSignal
Extension methodTyped
move-focus-out
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var moveFocusOutSignal: NotebookSignalName { get }
-
onPageAdded(flags:
Extension methodhandler: ) the
page-added
signal is emitted in the notebook right after a page is added to the notebook.Note
This represents the underlyingpage-added
signalDeclaration
Swift
@discardableResult @inlinable func onPageAdded(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ child: WidgetRef, _ pageNum: UInt) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
child
the child
GtkWidget
affectedpageNum
the new page number for
child
handler
The signal handler to call Run the given callback whenever the
pageAdded
signal is emitted -
pageAddedSignal
Extension methodTyped
page-added
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var pageAddedSignal: NotebookSignalName { get }
-
onPageRemoved(flags:
Extension methodhandler: ) the
page-removed
signal is emitted in the notebook right after a page is removed from the notebook.Note
This represents the underlyingpage-removed
signalDeclaration
Swift
@discardableResult @inlinable func onPageRemoved(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ child: WidgetRef, _ pageNum: UInt) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
child
the child
GtkWidget
affectedpageNum
the
child
page numberhandler
The signal handler to call Run the given callback whenever the
pageRemoved
signal is emitted -
pageRemovedSignal
Extension methodTyped
page-removed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var pageRemovedSignal: NotebookSignalName { get }
-
onPageReordered(flags:
Extension methodhandler: ) the
page-reordered
signal is emitted in the notebook right after a page has been reordered.Note
This represents the underlyingpage-reordered
signalDeclaration
Swift
@discardableResult @inlinable func onPageReordered(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ child: WidgetRef, _ pageNum: UInt) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
child
the child
GtkWidget
affectedpageNum
the new page number for
child
handler
The signal handler to call Run the given callback whenever the
pageReordered
signal is emitted -
pageReorderedSignal
Extension methodTyped
page-reordered
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var pageReorderedSignal: NotebookSignalName { get }
-
onReorderTab(flags:
Extension methodhandler: ) Note
This represents the underlyingreorder-tab
signalDeclaration
Swift
@discardableResult @inlinable func onReorderTab(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ object: DirectionType, _ p0: Bool) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
object
none
p0
none
handler
The signal handler to call Run the given callback whenever the
reorderTab
signal is emitted -
reorderTabSignal
Extension methodTyped
reorder-tab
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var reorderTabSignal: NotebookSignalName { get }
-
onSelectPage(flags:
Extension methodhandler: ) Note
This represents the underlyingselect-page
signalDeclaration
Swift
@discardableResult @inlinable func onSelectPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ object: Bool) -> Bool) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
object
none
handler
The signal handler to call Run the given callback whenever the
selectPage
signal is emitted -
selectPageSignal
Extension methodTyped
select-page
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var selectPageSignal: NotebookSignalName { get }
-
onSwitchPage(flags:
Extension methodhandler: ) Emitted when the user or a function changes the current page.
Note
This represents the underlyingswitch-page
signalDeclaration
Swift
@discardableResult @inlinable func onSwitchPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ page: WidgetRef, _ pageNum: UInt) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
page
the new current page
pageNum
the index of the page
handler
The signal handler to call Run the given callback whenever the
switchPage
signal is emitted -
switchPageSignal
Extension methodTyped
switch-page
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var switchPageSignal: NotebookSignalName { get }
-
onNotifyEnablePopup(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::enable-popup
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyEnablePopup(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyEnablePopup
signal is emitted -
notifyEnablePopupSignal
Extension methodTyped
notify::enable-popup
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyEnablePopupSignal: NotebookSignalName { get }
-
onNotifyGroupName(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::group-name
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyGroupName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyGroupName
signal is emitted -
notifyGroupNameSignal
Extension methodTyped
notify::group-name
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyGroupNameSignal: NotebookSignalName { get }
-
onNotifyPage(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::page
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyPage(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyPage
signal is emitted -
notifyPageSignal
Extension methodTyped
notify::page
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyPageSignal: NotebookSignalName { get }
-
onNotifyScrollable(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::scrollable
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyScrollable(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyScrollable
signal is emitted -
notifyScrollableSignal
Extension methodTyped
notify::scrollable
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyScrollableSignal: NotebookSignalName { get }
-
onNotifyShowBorder(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-border
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowBorder(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowBorder
signal is emitted -
notifyShowBorderSignal
Extension methodTyped
notify::show-border
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowBorderSignal: NotebookSignalName { get }
-
onNotifyShowTabs(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::show-tabs
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyShowTabs(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyShowTabs
signal is emitted -
notifyShowTabsSignal
Extension methodTyped
notify::show-tabs
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyShowTabsSignal: NotebookSignalName { get }
-
onNotifyTabPos(flags:
Extension methodhandler: ) The notify signal is emitted on an object when one of its properties has its value set through
g_object_set_property()
,g_object_set()
, et al.Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with
G_PARAM_EXPLICIT_NOTIFY
, then any call tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_object_notify_by_pspec()
, and common practice is to do that only when the value has actually changed.This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the
g_signal_connect()
call, like this:(C Language Example):
g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view)
It is important to note that you must use canonical parameter names as detail strings for the notify signal.
Note
This represents the underlyingnotify::tab-pos
signalDeclaration
Swift
@discardableResult @inlinable func onNotifyTabPos(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: NotebookRef, _ pspec: ParamSpecRef) -> Void) -> Int
Parameters
flags
Flags
unownedSelf
Reference to instance of self
pspec
the
GParamSpec
of the property which changed.handler
The signal handler to call Run the given callback whenever the
notifyTabPos
signal is emitted -
notifyTabPosSignal
Extension methodTyped
notify::tab-pos
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyTabPosSignal: NotebookSignalName { get }
-
appendPage(child:
Extension methodtabLabel: ) Appends a page to
notebook
.Declaration
Swift
@inlinable func appendPage<WidgetT>(child: WidgetT, tabLabel: WidgetT?) -> Int where WidgetT : WidgetProtocol
-
appendPageMenu(child:
Extension methodtabLabel: menuLabel: ) Appends a page to
notebook
, specifying the widget to use as the label in the popup menu.Declaration
Swift
@inlinable func appendPageMenu<WidgetT>(child: WidgetT, tabLabel: WidgetT?, menuLabel: WidgetT?) -> Int where WidgetT : WidgetProtocol
-
detachTab(child:
Extension method) Removes the child from the notebook.
This function is very similar to
gtk_container_remove()
, but additionally informs the notebook that the removal is happening as part of a tab DND operation, which should not be cancelled.Declaration
Swift
@inlinable func detachTab<WidgetT>(child: WidgetT) where WidgetT : WidgetProtocol
-
getActionWidget(packType:
Extension method) Gets one of the action widgets. See
gtk_notebook_set_action_widget()
.Declaration
Swift
@inlinable func getActionWidget(packType: GtkPackType) -> WidgetRef!
-
getCurrentPage()
Extension methodReturns the page number of the current page.
Declaration
Swift
@inlinable func getCurrentPage() -> Int
-
getGroupName()
Extension methodGets the current group name for
notebook
.Declaration
Swift
@inlinable func getGroupName() -> String!
-
getMenuLabel(child:
Extension method) Retrieves the menu label widget of the page containing
child
.Declaration
Swift
@inlinable func getMenuLabel<WidgetT>(child: WidgetT) -> WidgetRef! where WidgetT : WidgetProtocol
-
getMenuLabelText(child:
Extension method) Retrieves the text of the menu label for the page containing
child
.Declaration
Swift
@inlinable func getMenuLabelText<WidgetT>(child: WidgetT) -> String! where WidgetT : WidgetProtocol
-
getNPages()
Extension methodGets the number of pages in a notebook.
Declaration
Swift
@inlinable func getNPages() -> Int
-
getNthPage(pageNum:
Extension method) Returns the child widget contained in page number
page_num
.Declaration
Swift
@inlinable func getNthPage(pageNum: Int) -> WidgetRef!
-
getScrollable()
Extension methodReturns whether the tab label area has arrows for scrolling. See
gtk_notebook_set_scrollable()
.Declaration
Swift
@inlinable func getScrollable() -> Bool
-
getShowBorder()
Extension methodReturns whether a bevel will be drawn around the notebook pages. See
gtk_notebook_set_show_border()
.Declaration
Swift
@inlinable func getShowBorder() -> Bool
-
getShowTabs()
Extension methodReturns whether the tabs of the notebook are shown. See
gtk_notebook_set_show_tabs()
.Declaration
Swift
@inlinable func getShowTabs() -> Bool
-
getTabDetachable(child:
Extension method) Returns whether the tab contents can be detached from
notebook
.Declaration
Swift
@inlinable func getTabDetachable<WidgetT>(child: WidgetT) -> Bool where WidgetT : WidgetProtocol
-
getTabHborder()
Extension methodReturns the horizontal width of a tab border.
get_tab_hborder is deprecated: this function returns zero
Declaration
Swift
@available(*, deprecated) @inlinable func getTabHborder() -> guint16
-
getTabLabel(child:
Extension method) Returns the tab label widget for the page
child
.nil
is returned ifchild
is not innotebook
or if no tab label has specifically been set forchild
.Declaration
Swift
@inlinable func getTabLabel<WidgetT>(child: WidgetT) -> WidgetRef! where WidgetT : WidgetProtocol
-
getTabLabelText(child:
Extension method) Retrieves the text of the tab label for the page containing
child
.Declaration
Swift
@inlinable func getTabLabelText<WidgetT>(child: WidgetT) -> String! where WidgetT : WidgetProtocol
-
getTabPos()
Extension methodGets the edge at which the tabs for switching pages in the notebook are drawn.
Declaration
Swift
@inlinable func getTabPos() -> GtkPositionType
-
getTabReorderable(child:
Extension method) Gets whether the tab can be reordered via drag and drop or not.
Declaration
Swift
@inlinable func getTabReorderable<WidgetT>(child: WidgetT) -> Bool where WidgetT : WidgetProtocol
-
getTabVborder()
Extension methodReturns the vertical width of a tab border.
get_tab_vborder is deprecated: this function returns zero
Declaration
Swift
@available(*, deprecated) @inlinable func getTabVborder() -> guint16
-
insertPage(child:
Extension methodtabLabel: position: ) Insert a page into
notebook
at the given position.Declaration
Swift
@inlinable func insertPage<WidgetT>(child: WidgetT, tabLabel: WidgetT?, position: Int) -> Int where WidgetT : WidgetProtocol
-
insertPageMenu(child:
Extension methodtabLabel: menuLabel: position: ) Insert a page into
notebook
at the given position, specifying the widget to use as the label in the popup menu.Declaration
Swift
@inlinable func insertPageMenu<WidgetT>(child: WidgetT, tabLabel: WidgetT?, menuLabel: WidgetT?, position: Int) -> Int where WidgetT : WidgetProtocol
-
nextPage()
Extension methodSwitches to the next page. Nothing happens if the current page is the last page.
Declaration
Swift
@inlinable func nextPage()
-
pageNum(child:
Extension method) Finds the index of the page which contains the given child widget.
Declaration
Swift
@inlinable func pageNum<WidgetT>(child: WidgetT) -> Int where WidgetT : WidgetProtocol
-
popupDisable()
Extension methodDisables the popup menu.
Declaration
Swift
@inlinable func popupDisable()
-
popupEnable()
Extension methodEnables the popup menu: if the user clicks with the right mouse button on the tab labels, a menu with all the pages will be popped up.
Declaration
Swift
@inlinable func popupEnable()
-
prependPage(child:
Extension methodtabLabel: ) Prepends a page to
notebook
.Declaration
Swift
@inlinable func prependPage<WidgetT>(child: WidgetT, tabLabel: WidgetT?) -> Int where WidgetT : WidgetProtocol
-
prependPageMenu(child:
Extension methodtabLabel: menuLabel: ) Prepends a page to
notebook
, specifying the widget to use as the label in the popup menu.Declaration
Swift
@inlinable func prependPageMenu<WidgetT>(child: WidgetT, tabLabel: WidgetT?, menuLabel: WidgetT?) -> Int where WidgetT : WidgetProtocol
-
prevPage()
Extension methodSwitches to the previous page. Nothing happens if the current page is the first page.
Declaration
Swift
@inlinable func prevPage()
-
removePage(pageNum:
Extension method) Removes a page from the notebook given its index in the notebook.
Declaration
Swift
@inlinable func removePage(pageNum: Int)
-
reorder(child:
Extension methodposition: ) Reorders the page containing
child
, so that it appears in positionposition
. Ifposition
is greater than or equal to the number of children in the list or negative,child
will be moved to the end of the list.Declaration
Swift
@inlinable func reorder<WidgetT>(child: WidgetT, position: Int) where WidgetT : WidgetProtocol
-
setAction(widget:
Extension methodpackType: ) Sets
widget
as one of the action widgets. Depending on the pack type the widget will be placed before or after the tabs. You can use aGtkBox
if you need to pack more than one widget on the same side.Note that action widgets are “internal” children of the notebook and thus not included in the list returned from
gtk_container_foreach()
.Declaration
Swift
@inlinable func setAction<WidgetT>(widget: WidgetT, packType: GtkPackType) where WidgetT : WidgetProtocol
-
setCurrentPage(pageNum:
Extension method) Switches to the page number
page_num
.Note that due to historical reasons, GtkNotebook refuses to switch to a page unless the child widget is visible. Therefore, it is recommended to show child widgets before adding them to a notebook.
Declaration
Swift
@inlinable func setCurrentPage(pageNum: Int)
-
set(groupName:
Extension method) Sets a group name for
notebook
.Notebooks with the same name will be able to exchange tabs via drag and drop. A notebook with a
nil
group name will not be able to exchange tabs with any other notebook.Declaration
Swift
@inlinable func set(groupName: UnsafePointer<gchar>? = nil)
-
setMenuLabel(child:
Extension methodmenuLabel: ) Changes the menu label for the page containing
child
.Declaration
Swift
@inlinable func setMenuLabel<WidgetT>(child: WidgetT, menuLabel: WidgetT?) where WidgetT : WidgetProtocol
-
setMenuLabelText(child:
Extension methodmenuText: ) Creates a new label and sets it as the menu label of
child
.Declaration
Swift
@inlinable func setMenuLabelText<WidgetT>(child: WidgetT, menuText: UnsafePointer<gchar>!) where WidgetT : WidgetProtocol
-
set(scrollable:
Extension method) Sets whether the tab label area will have arrows for scrolling if there are too many tabs to fit in the area.
Declaration
Swift
@inlinable func set(scrollable: Bool)
-
set(showBorder:
Extension method) Sets whether a bevel will be drawn around the notebook pages. This only has a visual effect when the tabs are not shown. See
gtk_notebook_set_show_tabs()
.Declaration
Swift
@inlinable func set(showBorder: Bool)
-
set(showTabs:
Extension method) Sets whether to show the tabs for the notebook or not.
Declaration
Swift
@inlinable func set(showTabs: Bool)
-
setTabDetachable(child:
Extension methoddetachable: ) Sets whether the tab can be detached from
notebook
to another notebook or widget.Note that 2 notebooks must share a common group identificator (see
gtk_notebook_set_group_name()
) to allow automatic tabs interchange between them.If you want a widget to interact with a notebook through DnD (i.e.: accept dragged tabs from it) it must be set as a drop destination and accept the target “GTK_NOTEBOOK_TAB”. The notebook will fill the selection with a GtkWidget** pointing to the child widget that corresponds to the dropped tab.
Note that you should use
gtk_notebook_detach_tab()
instead ofgtk_container_remove()
if you want to remove the tab from the source notebook as part of accepting a drop. Otherwise, the source notebook will think that the dragged tab was removed from underneath the ongoing drag operation, and will initiate a drag cancel animation.(C Language Example):
static void on_drag_data_received (GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint info, guint time, gpointer user_data) { GtkWidget *notebook; GtkWidget **child; notebook = gtk_drag_get_source_widget (context); child = (void*) gtk_selection_data_get_data (data); // process_widget (*child); gtk_notebook_detach_tab (GTK_NOTEBOOK (notebook), *child); }
If you want a notebook to accept drags from other widgets, you will have to set your own DnD code to do it.
Declaration
Swift
@inlinable func setTabDetachable<WidgetT>(child: WidgetT, detachable: Bool) where WidgetT : WidgetProtocol
-
setTabLabel(child:
Extension methodtabLabel: ) Changes the tab label for
child
. Ifnil
is specified fortab_label
, then the page will have the label “page N”.Declaration
Swift
@inlinable func setTabLabel<WidgetT>(child: WidgetT, tabLabel: WidgetT?) where WidgetT : WidgetProtocol
-
setTabLabelText(child:
Extension methodtabText: ) Creates a new label and sets it as the tab label for the page containing
child
.Declaration
Swift
@inlinable func setTabLabelText<WidgetT>(child: WidgetT, tabText: UnsafePointer<gchar>!) where WidgetT : WidgetProtocol
-
setTab(pos:
Extension method) Sets the edge at which the tabs for switching pages in the notebook are drawn.
Declaration
Swift
@inlinable func setTab(pos: GtkPositionType)
-
setTabReorderable(child:
Extension methodreorderable: ) Sets whether the notebook tab can be reordered via drag and drop or not.
Declaration
Swift
@inlinable func setTabReorderable<WidgetT>(child: WidgetT, reorderable: Bool) where WidgetT : WidgetProtocol
-
currentPage
Extension methodReturns the page number of the current page.
Declaration
Swift
@inlinable var currentPage: Int { get nonmutating set }
-
groupName
Extension methodGets the current group name for
notebook
.Declaration
Swift
@inlinable var groupName: String! { get nonmutating set }
-
nPages
Extension methodGets the number of pages in a notebook.
Declaration
Swift
@inlinable var nPages: Int { get }
-
scrollable
Extension methodUndocumented
Declaration
Swift
@inlinable var scrollable: Bool { get nonmutating set }
-
showBorder
Extension methodReturns whether a bevel will be drawn around the notebook pages. See
gtk_notebook_set_show_border()
.Declaration
Swift
@inlinable var showBorder: Bool { get nonmutating set }
-
showTabs
Extension methodReturns whether the tabs of the notebook are shown. See
gtk_notebook_set_show_tabs()
.Declaration
Swift
@inlinable var showTabs: Bool { get nonmutating set }
-
tabHborder
Extension methodReturns the horizontal width of a tab border.
get_tab_hborder is deprecated: this function returns zero
Declaration
Swift
@inlinable var tabHborder: guint16 { get }
-
tabPos
Extension methodGets the edge at which the tabs for switching pages in the notebook are drawn.
Declaration
Swift
@inlinable var tabPos: GtkPositionType { get nonmutating set }
-
tabVborder
Extension methodReturns the vertical width of a tab border.
get_tab_vborder is deprecated: this function returns zero
Declaration
Swift
@inlinable var tabVborder: guint16 { get }