1.132 <GtkNotebook>

Class: <GtkNotebook>

It derives from <GtkWidget>.

Switches between children using tabs.

There are many configuration options for <GtkNotebook>. Among other things, you can choose on which edge the tabs appear (see notebook:set-tab-pos), whether, if there are too many tabs to fit the notebook should be made bigger or scrolling arrows added (see notebook:set-scrollable), and whether there will be a popup menu allowing the users to switch pages. (see 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>

Shortcuts and Gestures

<GtkNotebook> supports the following keyboard shortcuts:

  • Shift+F10 or Menu opens the context menu.
  • Home moves the focus to the first tab.
  • End moves the focus to the last tab.

Additionally, the following signals have default keybindings:

Tabs support drag-and-drop between notebooks sharing the same group-name, or to new windows by handling the ::create-window signal.

Actions

<GtkNotebook> defines a set of built-in actions:

  • menu.popup opens the tabs context menu.

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 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.AccessibleRole.group for the notebook widget
  • Gtk.AccessibleRole.tab_list for the list of tabs
  • Gtk.AccessibleRole.tab role for each tab
  • Gtk.AccessibleRole.tab_panel for each page

Properties

Property: notebook:enable-popup self

If #t, pressing the right mouse button on the notebook shows a page switching menu.

Its value is a boolean.

Set it with (set! (notebook:enable-popup self) value).

Property: notebook:group-name self

Group name for tab drag and drop.

Its value is a string, or #f.

Set it with (set! (notebook:group-name self) value).

Property: notebook:page self

The index of the current page.

Its value is a 32-bit integer.

Set it with (set! (notebook:page self) value).

Property: notebook:pages self

A selection model with the pages.

Its value is a <GListModel>, or #f.

It is read only.

Property: notebook:scrollable self

If #t, scroll arrows are added if there are too many pages to fit.

Its value is a boolean.

Set it with (set! (notebook:scrollable self) value).

Property: notebook:show-border self

Whether the border should be shown.

Its value is a boolean.

Set it with (set! (notebook:show-border self) value).

Property: notebook:show-tabs self

Whether tabs should be shown.

Its value is a boolean.

Set it with (set! (notebook:show-tabs self) value).

Property: notebook:tab-pos self

Which side of the notebook holds the tabs.

Its value is a <GtkPositionType> (or, to set it, one of its symbols).

Set it with (set! (notebook:tab-pos self) value).

Procedures

Method: notebook:append-page self child [tab-label] ⇒ %return
Method: append-page self child [tab-label] ⇒ %return

Appends a page to self.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the <GtkWidget> to use as the contents of the page

tab-label

Passed, or left out: a <GtkWidget>, or #f.

the <GtkWidget> to be used as the label for the page, or #f to use the default label, “page N”

%return

Returned: a 32-bit integer.

the index (starting from 0) of the appended page in the notebook, or -1 if function fails

Method: notebook:append-page-menu self child [tab-label] [menu-label] ⇒ %return
Method: append-page-menu self child [tab-label] [menu-label] ⇒ %return

Appends a page to self, specifying the widget to use as the label in the popup menu.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the <GtkWidget> to use as the contents of the page

tab-label

Passed, or left out: a <GtkWidget>, or #f.

the <GtkWidget> to be used as the label for the page, or #f to use the default label, “page N”

menu-label

Passed, or left out: a <GtkWidget>, or #f.

the widget to use as a label for the page-switch menu, if that is enabled. If #f, and tab-label is a <GtkLabel> or #f, then the menu label will be a newly created label with the same text as tab-label; if tab-label is not a <GtkLabel>, menu-label must be specified if the page-switch menu is to be used.

%return

Returned: a 32-bit integer.

the index (starting from 0) of the appended page in the notebook, or -1 if function fails

Method: notebook:detach-tab self child
Method: detach-tab self child

Removes the child from the notebook.

This function is very similar to notebook:remove-page, but additionally informs the notebook that the removal is happening as part of a tab DND operation, which should not be cancelled.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a child

Method: notebook:get-action-widget self pack-type ⇒ %return
Method: get-action-widget self pack-type ⇒ %return

Gets one of the action widgets.

See notebook:set-action-widget.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

pack-type

Passed: a <GtkPackType>, or one of its symbols.

pack type of the action widget to receive

%return

Returned: a <GtkWidget>, or #f.

The action widget with the given pack-type or #f when this action widget has not been set

Method: notebook:get-current-page self ⇒ %return
Method: get-current-page self ⇒ %return

Returns the page number of the current page.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

%return

Returned: a 32-bit integer.

the index (starting from 0) of the current page in the notebook. If the notebook has no pages, then -1 will be returned.

Method: notebook:get-group-name self ⇒ %return
Method: get-group-name self ⇒ %return

Gets the current group name for self.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

%return

Returned: a string, or #f.

the group name, or #f if none is set

Method: notebook:get-menu-label self child ⇒ %return
Method: get-menu-label self child ⇒ %return

Retrieves the menu label widget of the page containing child.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a widget contained in a page of self

%return

Returned: a <GtkWidget>, or #f.

the menu label, or #f if the notebook page does not have a menu label other than the default (the tab label).

Method: notebook:get-menu-label-text self child ⇒ %return
Method: get-menu-label-text self child ⇒ %return

Retrieves the text of the menu label for the page containing child.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the child widget of a page of the notebook.

%return

Returned: a string, or #f.

the text of the tab label, or #f if the widget does not have a menu label other than the default menu label, or the menu label widget is not a <GtkLabel>. The string is owned by the widget and must not be freed.

Method: notebook:get-n-pages self ⇒ %return
Method: get-n-pages self ⇒ %return

Gets the number of pages in a notebook.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

%return

Returned: a 32-bit integer.

the number of pages in the notebook

Method: notebook:get-nth-page self page-num ⇒ %return
Method: get-nth-page self page-num ⇒ %return

Returns the child widget contained in page number page-num.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

page-num

Passed: a 32-bit integer.

the index of a page in the notebook, or -1 to get the last page

%return

Returned: a <GtkWidget>, or #f.

the child widget, or #f if page-num is out of bounds

Method: notebook:get-page self child ⇒ %return
Method: get-page self child ⇒ %return

Returns the <GtkNotebookPage> for child.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a child of self

%return

Returned: a <GtkNotebookPage>.

the <GtkNotebookPage> for child

Method: notebook:get-pages self ⇒ %return
Method: get-pages self ⇒ %return

Returns a <GListModel> that contains the pages of the notebook.

This can be used to keep an up-to-date view. The model also implements <GtkSelectionModel> and can be used to track and modify the visible page.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

%return

Returned: a <GListModel>.

a <GListModel> for the notebook’s children

Method: notebook:get-scrollable? self ⇒ %return
Method: get-scrollable? self ⇒ %return

Returns whether the tab label area has arrows for scrolling.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

%return

Returned: a boolean.

#t if arrows for scrolling are present

Method: notebook:get-show-border? self ⇒ %return
Method: get-show-border? self ⇒ %return

Returns whether a bevel will be drawn around the notebook pages.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

%return

Returned: a boolean.

#t if the bevel is drawn

Method: notebook:get-show-tabs? self ⇒ %return
Method: get-show-tabs? self ⇒ %return

Returns whether the tabs of the notebook are shown.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

%return

Returned: a boolean.

#t if the tabs are shown

Method: notebook:get-tab-detachable? self child ⇒ %return
Method: get-tab-detachable? self child ⇒ %return

Returns whether the tab contents can be detached from self.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a child <GtkWidget>

%return

Returned: a boolean.

#t if the tab is detachable.

Method: notebook:get-tab-label self child ⇒ %return
Method: get-tab-label self child ⇒ %return

Returns the tab label widget for the page child.

#f is returned if child is not in self or if no tab label has specifically been set for child.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the page

%return

Returned: a <GtkWidget>, or #f.

the tab label

Method: notebook:get-tab-label-text self child ⇒ %return
Method: get-tab-label-text self child ⇒ %return

Retrieves the text of the tab label for the page containing child.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a widget contained in a page of self

%return

Returned: a string, or #f.

the text of the tab label, or #f if the tab label widget is not a <GtkLabel>. The string is owned by the widget and must not be freed.

Method: notebook:get-tab-pos self ⇒ %return
Method: get-tab-pos self ⇒ %return

Gets the edge at which the tabs are drawn.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

%return

Returned: a <GtkPositionType>.

the edge at which the tabs are drawn

Method: notebook:get-tab-reorderable? self child ⇒ %return
Method: get-tab-reorderable? self child ⇒ %return

Gets whether the tab can be reordered via drag and drop or not.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a child <GtkWidget>

%return

Returned: a boolean.

#t if the tab is reorderable.

Method: notebook:insert-page self child tab-label position ⇒ %return
Method: insert-page self child tab-label position ⇒ %return

Insert a page into self at the given position.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the <GtkWidget> to use as the contents of the page

tab-label

Passed: a <GtkWidget>, or #f.

the <GtkWidget> to be used as the label for the page, or #f to use the default label, “page N”

position

Passed: a 32-bit integer.

the index (starting at 0) at which to insert the page, or -1 to append the page after all other pages

%return

Returned: a 32-bit integer.

the index (starting from 0) of the inserted page in the notebook, or -1 if function fails

Method: notebook:insert-page-menu self child tab-label menu-label position ⇒ %return
Method: insert-page-menu self child tab-label menu-label position ⇒ %return

Insert a page into self at the given position, specifying the widget to use as the label in the popup menu.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the <GtkWidget> to use as the contents of the page

tab-label

Passed: a <GtkWidget>, or #f.

the <GtkWidget> to be used as the label for the page, or #f to use the default label, “page N”

menu-label

Passed: a <GtkWidget>, or #f.

the widget to use as a label for the page-switch menu, if that is enabled. If #f, and tab-label is a <GtkLabel> or #f, then the menu label will be a newly created label with the same text as tab-label; if tab-label is not a <GtkLabel>, menu-label must be specified if the page-switch menu is to be used.

position

Passed: a 32-bit integer.

the index (starting at 0) at which to insert the page, or -1 to append the page after all other pages.

%return

Returned: a 32-bit integer.

the index (starting from 0) of the inserted page in the notebook

Procedure: notebook:new ⇒ %return

Creates a new <GtkNotebook> widget with no pages.

%return

Returned: a <GtkWidget>.

the newly created <GtkNotebook>

Method: notebook:next-page self
Method: next-page self

Switches to the next page.

Nothing happens if the current page is the last page.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

Method: notebook:page-num self child ⇒ %return
Method: page-num self child ⇒ %return

Finds the index of the page which contains the given child widget.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a <GtkWidget>

%return

Returned: a 32-bit integer.

the index of the page containing child, or -1 if child is not in the notebook

Method: notebook:popup-disable self
Method: popup-disable self

Disables the popup menu.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

Method: notebook:popup-enable self
Method: popup-enable self

Enables 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.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

Method: notebook:prepend-page self child [tab-label] ⇒ %return
Method: prepend-page self child [tab-label] ⇒ %return

Prepends a page to self.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the <GtkWidget> to use as the contents of the page

tab-label

Passed, or left out: a <GtkWidget>, or #f.

the <GtkWidget> to be used as the label for the page, or #f to use the default label, “page N”

%return

Returned: a 32-bit integer.

the index (starting from 0) of the prepended page in the notebook, or -1 if function fails

Method: notebook:prepend-page-menu self child [tab-label] [menu-label] ⇒ %return
Method: prepend-page-menu self child [tab-label] [menu-label] ⇒ %return

Prepends a page to self, specifying the widget to use as the label in the popup menu.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the <GtkWidget> to use as the contents of the page

tab-label

Passed, or left out: a <GtkWidget>, or #f.

the <GtkWidget> to be used as the label for the page, or #f to use the default label, “page N”

menu-label

Passed, or left out: a <GtkWidget>, or #f.

the widget to use as a label for the page-switch menu, if that is enabled. If #f, and tab-label is a <GtkLabel> or #f, then the menu label will be a newly created label with the same text as tab-label; if tab-label is not a <GtkLabel>, menu-label must be specified if the page-switch menu is to be used.

%return

Returned: a 32-bit integer.

the index (starting from 0) of the prepended page in the notebook, or -1 if function fails

Method: notebook:prev-page self
Method: prev-page self

Switches to the previous page.

Nothing happens if the current page is the first page.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

Method: notebook:remove-page self page-num
Method: remove-page self page-num

Removes a page from the notebook given its index in the notebook.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

page-num

Passed: a 32-bit integer.

the index of a notebook page, starting from 0. If -1, the last page will be removed.

Method: notebook:reorder-child self child position
Method: reorder-child self child position

Reorders the page containing child, so that it appears in position position.

If position 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.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the child to move

position

Passed: a 32-bit integer.

the new position, or -1 to move to the end

Method: notebook:set-action-widget self widget pack-type
Method: set-action-widget self widget pack-type

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 a <GtkBox> if you need to pack more than one widget on the same side.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

widget

Passed: a <GtkWidget>.

a <GtkWidget>

pack-type

Passed: a <GtkPackType>, or one of its symbols.

pack type of the action widget

Method: notebook:set-current-page self page-num
Method: set-current-page self page-num

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.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

page-num

Passed: a 32-bit integer.

index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the notebook, nothing will be done.

Method: notebook:set-group-name self [group-name]
Method: set-group-name self [group-name]

Sets a group name for self.

Notebooks with the same name will be able to exchange tabs via drag and drop. A notebook with a #f group name will not be able to exchange tabs with any other notebook.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

group-name

Passed, or left out: a string, or #f.

the name of the notebook group, or #f to unset it

Method: notebook:set-menu-label self child [menu-label]
Method: set-menu-label self child [menu-label]

Changes the menu label for the page containing child.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the child widget

menu-label

Passed, or left out: a <GtkWidget>, or #f.

the menu label, or #f for default

Method: notebook:set-menu-label-text self child menu-text
Method: set-menu-label-text self child menu-text

Creates a new label and sets it as the menu label of child.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the child widget

menu-text

Passed: a string.

the label text

Method: notebook:set-scrollable self scrollable
Method: set-scrollable self scrollable

Sets whether the tab label area will have arrows for scrolling if there are too many tabs to fit in the area.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

scrollable

Passed: a boolean.

#t if scroll arrows should be added

Method: notebook:set-show-border self show-border
Method: set-show-border self show-border

Sets whether a bevel will be drawn around the notebook pages.

This only has a visual effect when the tabs are not shown.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

show-border

Passed: a boolean.

#t if a bevel should be drawn around the notebook

Method: notebook:set-show-tabs self show-tabs
Method: set-show-tabs self show-tabs

Sets whether to show the tabs for the notebook or not.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

show-tabs

Passed: a boolean.

#t if the tabs should be shown

Method: notebook:set-tab-detachable self child detachable
Method: set-tab-detachable self child detachable

Sets whether the tab can be detached from self to another notebook or widget.

Note that two notebooks must share a common group identifier (see 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 by adding to it a <GtkDropTarget> controller that accepts the GType GTK_TYPE_NOTEBOOK_PAGE. The :value of said drop target will be preloaded with a <GtkNotebookPage> object that corresponds to the dropped tab, so you can process the value via ::accept or ::drop signals.

Note that you should use notebook:detach-tab instead of notebook:remove-page 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.

static void
on_drag_data_received (GtkWidget        *widget,
                       GdkDrop          *drop,
                       GtkSelectionData *data,
                       guint             time,
                       gpointer          user_data)
{
  GtkDrag *drag;
  GtkWidget *notebook;
  GtkWidget **child;

  drag = gtk_drop_get_drag (drop);
  notebook = g_object_get_data (drag, "gtk-notebook-drag-origin");
  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.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a child <GtkWidget>

detachable

Passed: a boolean.

whether the tab is detachable or not

Method: notebook:set-tab-label self child [tab-label]
Method: set-tab-label self child [tab-label]

Changes the tab label for child.

If #f is specified for tab-label, then the page will have the label “page N”.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the page

tab-label

Passed, or left out: a <GtkWidget>, or #f.

the tab label widget to use, or #f for default tab label

Method: notebook:set-tab-label-text self child tab-text
Method: set-tab-label-text self child tab-text

Creates a new label and sets it as the tab label for the page containing child.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

the page

tab-text

Passed: a string.

the label text

Method: notebook:set-tab-pos self pos
Method: set-tab-pos self pos

Sets the edge at which the tabs are drawn.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>.

pos

Passed: a <GtkPositionType>, or one of its symbols.

the edge to draw the tabs at

Method: notebook:set-tab-reorderable self child reorderable
Method: set-tab-reorderable self child reorderable

Sets whether the notebook tab can be reordered via drag and drop or not.

self

Passed: a <GtkNotebook>.

a <GtkNotebook>

child

Passed: a <GtkWidget>.

a child <GtkWidget>

reorderable

Passed: a boolean.

whether the tab is reorderable or not

Signals

Signal: notebook:change-current-page

Connect a handler with (connect object notebook:change-current-page handler). It is called as (handler self page) ⇒ %return.

Emitted when the current page should be changed.

The default bindings for this signal are Ctrl+Alt+PgUp, Ctrl+Alt+PgDn, Ctrl+PgUp and Ctrl+PgDn.

self

Passed: a <GtkNotebook>.

page

Passed: a 32-bit integer.

the page index

%return

Returned: a boolean.

whether the page was changed

Signal: notebook:create-window

Connect a handler with (connect object notebook:create-window handler). It is called as (handler self page) ⇒ %return.

The ::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 ).

self

Passed: a <GtkNotebook>.

page

Passed: a <GtkWidget>.

the tab of notebook that is being detached

%return

Returned: a <GtkNotebook>, or #f.

a <GtkNotebook> that page should be added to

Signal: notebook:focus-tab

Connect a handler with (connect object notebook:focus-tab handler). It is called as (handler self tab) ⇒ %return.

Emitted when a tab should be focused.

self

Passed: a <GtkNotebook>.

tab

Passed: a <GtkNotebookTab>.

the notebook tab

%return

Returned: a boolean.

whether the tab has been focused

Signal: notebook:move-focus-out

Connect a handler with (connect object notebook:move-focus-out handler). It is called as (handler self direction).

Emitted when focus was moved out.

The default bindings for this signal are Ctrl+Tab, Ctrl+Shift+Tab, Ctrl+←, Ctrl+→, Ctrl+↑ and Ctrl+↓.

self

Passed: a <GtkNotebook>.

direction

Passed: a <GtkDirectionType>.

the direction to move the focus

Signal: notebook:page-added

Connect a handler with (connect object notebook:page-added handler). It is called as (handler self child page-num).

the ::page-added signal is emitted in the notebook right after a page is added to the notebook.

self

Passed: a <GtkNotebook>.

child

Passed: a <GtkWidget>.

the child <GtkWidget> affected

page-num

Passed: an unsigned 32-bit integer.

the new page number for child

Signal: notebook:page-removed

Connect a handler with (connect object notebook:page-removed handler). It is called as (handler self child page-num).

the ::page-removed signal is emitted in the notebook right after a page is removed from the notebook.

self

Passed: a <GtkNotebook>.

child

Passed: a <GtkWidget>.

the child <GtkWidget> affected

page-num

Passed: an unsigned 32-bit integer.

the child page number

Signal: notebook:page-reordered

Connect a handler with (connect object notebook:page-reordered handler). It is called as (handler self child page-num).

the ::page-reordered signal is emitted in the notebook right after a page has been reordered.

self

Passed: a <GtkNotebook>.

child

Passed: a <GtkWidget>.

the child <GtkWidget> affected

page-num

Passed: an unsigned 32-bit integer.

the new page number for child

Signal: notebook:reorder-tab

Connect a handler with (connect object notebook:reorder-tab handler). It is called as (handler self direction move-to-last) ⇒ %return.

Emitted when the tab should be reordered.

The default bindings for this signal are Alt+Home, Alt+End, Alt+PgUp, Alt+PgDn, Alt+←, Alt+→, Alt+↑ and Alt+↓.

self

Passed: a <GtkNotebook>.

direction

Passed: a <GtkDirectionType>.

the direction to move the tab

move-to-last

Passed: a boolean.

whether to move to the last position

%return

Returned: a boolean.

whether the tab was moved.

Signal: notebook:select-page

Connect a handler with (connect object notebook:select-page handler). It is called as (handler self move-focus) ⇒ %return.

Emitted when a page should be selected.

The default binding for this signal is ␣.

self

Passed: a <GtkNotebook>.

move-focus

Passed: a boolean.

whether to move focus

%return

Returned: a boolean.

whether the page was selected

Signal: notebook:switch-page

Connect a handler with (connect object notebook:switch-page handler). It is called as (handler self page page-num).

Emitted when the user or a function changes the current page.

self

Passed: a <GtkNotebook>.

page

Passed: a <GtkWidget>.

the new current page

page-num

Passed: an unsigned 32-bit integer.

the index of the page