CtkNotebook

CtkNotebook — A tabbed notebook container

Functions

CtkWidget * ctk_notebook_new ()
gint ctk_notebook_append_page ()
gint ctk_notebook_append_page_menu ()
gint ctk_notebook_prepend_page ()
gint ctk_notebook_prepend_page_menu ()
gint ctk_notebook_insert_page ()
gint ctk_notebook_insert_page_menu ()
void ctk_notebook_remove_page ()
void ctk_notebook_detach_tab ()
gint ctk_notebook_page_num ()
void ctk_notebook_next_page ()
void ctk_notebook_prev_page ()
void ctk_notebook_reorder_child ()
void ctk_notebook_set_tab_pos ()
void ctk_notebook_set_show_tabs ()
void ctk_notebook_set_show_border ()
void ctk_notebook_set_scrollable ()
void ctk_notebook_popup_enable ()
void ctk_notebook_popup_disable ()
gint ctk_notebook_get_current_page ()
CtkWidget * ctk_notebook_get_menu_label ()
CtkWidget * ctk_notebook_get_nth_page ()
gint ctk_notebook_get_n_pages ()
CtkWidget * ctk_notebook_get_tab_label ()
void ctk_notebook_set_menu_label ()
void ctk_notebook_set_menu_label_text ()
void ctk_notebook_set_tab_label ()
void ctk_notebook_set_tab_label_text ()
void ctk_notebook_set_tab_reorderable ()
void ctk_notebook_set_tab_detachable ()
const gchar * ctk_notebook_get_menu_label_text ()
gboolean ctk_notebook_get_scrollable ()
gboolean ctk_notebook_get_show_border ()
gboolean ctk_notebook_get_show_tabs ()
const gchar * ctk_notebook_get_tab_label_text ()
CtkPositionType ctk_notebook_get_tab_pos ()
gboolean ctk_notebook_get_tab_reorderable ()
gboolean ctk_notebook_get_tab_detachable ()
guint16 ctk_notebook_get_tab_hborder ()
guint16 ctk_notebook_get_tab_vborder ()
void ctk_notebook_set_current_page ()
void ctk_notebook_set_group_name ()
const gchar * ctk_notebook_get_group_name ()
void ctk_notebook_set_action_widget ()
CtkWidget * ctk_notebook_get_action_widget ()

Properties

gboolean enable-popup Read / Write
char * group-name Read / Write
int page Read / Write
gboolean scrollable Read / Write
gboolean show-border Read / Write
gboolean show-tabs Read / Write
CtkPositionType tab-pos Read / Write

Signals

gboolean change-current-page Action
CtkNotebook* create-window Run Last
gboolean focus-tab Action
void move-focus-out Action
void page-added Run Last
void page-removed Run Last
void page-reordered Run Last
gboolean reorder-tab Action
gboolean select-page Action
void switch-page Run Last

Types and Values

struct CtkNotebook

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── CtkWidget
            ╰── CtkContainer
                ╰── CtkNotebook

Implemented Interfaces

CtkNotebook implements AtkImplementorIface and CtkBuildable.

Includes

#include <ctk/ctk.h>

Description

The CtkNotebook widget is a CtkContainer whose children are pages that can be switched between using tab labels along one edge.

There are many configuration options for CtkNotebook. Among other things, you can choose on which edge the tabs appear (see ctk_notebook_set_tab_pos()), whether, if there are too many tabs to fit the notebook should be made bigger or scrolling arrows added (see ctk_notebook_set_scrollable()), and whether there will be a popup menu allowing the users to switch pages. (see ctk_notebook_popup_enable(), ctk_notebook_popup_disable())

CtkNotebook as CtkBuildable

The CtkNotebook implementation of the CtkBuildable 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 CtkNotebook:

1
2
3
4
5
6
7
8
9
10
11
12
<object class="CtkNotebook">
  <child>
    <object class="CtkLabel" id="notebook-content">
      <property name="label">Content</property>
    </object>
  </child>
  <child type="tab">
    <object class="CtkLabel" id="notebook-tab">
      <property name="label">Tab</property>
    </object>
  </child>
</object>


CSS nodes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
notebook
├── header.top
   ├── [<action widget>]
   ├── tabs
      ├── [arrow]
      ├── tab
         ╰── <tab label>
      
      ├── tab[.reorderable-page]
         ╰── <tab label>
      ╰── [arrow]
   ╰── [<action widget>]

╰── stack
    ├── <child>
    
    ╰── <child>

CtkNotebook 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 ctk_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.

Functions

ctk_notebook_new ()

CtkWidget *
ctk_notebook_new (void);

Creates a new CtkNotebook widget with no pages.

Returns

the newly created CtkNotebook


ctk_notebook_append_page ()

gint
ctk_notebook_append_page (CtkNotebook *notebook,
                          CtkWidget *child,
                          CtkWidget *tab_label);

Appends a page to notebook .

Parameters

notebook

a CtkNotebook

 

child

the CtkWidget to use as the contents of the page

 

tab_label

the CtkWidget to be used as the label for the page, or NULL to use the default label, “page N”.

[allow-none]

Returns

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


ctk_notebook_append_page_menu ()

gint
ctk_notebook_append_page_menu (CtkNotebook *notebook,
                               CtkWidget *child,
                               CtkWidget *tab_label,
                               CtkWidget *menu_label);

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

Parameters

notebook

a CtkNotebook

 

child

the CtkWidget to use as the contents of the page

 

tab_label

the CtkWidget to be used as the label for the page, or NULL to use the default label, “page N”.

[allow-none]

menu_label

the widget to use as a label for the page-switch menu, if that is enabled. If NULL, and tab_label is a CtkLabel or NULL, then the menu label will be a newly created label with the same text as tab_label ; if tab_label is not a CtkLabel, menu_label must be specified if the page-switch menu is to be used.

[allow-none]

Returns

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


ctk_notebook_prepend_page ()

gint
ctk_notebook_prepend_page (CtkNotebook *notebook,
                           CtkWidget *child,
                           CtkWidget *tab_label);

Prepends a page to notebook .

Parameters

notebook

a CtkNotebook

 

child

the CtkWidget to use as the contents of the page

 

tab_label

the CtkWidget to be used as the label for the page, or NULL to use the default label, “page N”.

[allow-none]

Returns

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


ctk_notebook_prepend_page_menu ()

gint
ctk_notebook_prepend_page_menu (CtkNotebook *notebook,
                                CtkWidget *child,
                                CtkWidget *tab_label,
                                CtkWidget *menu_label);

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

Parameters

notebook

a CtkNotebook

 

child

the CtkWidget to use as the contents of the page

 

tab_label

the CtkWidget to be used as the label for the page, or NULL to use the default label, “page N”.

[allow-none]

menu_label

the widget to use as a label for the page-switch menu, if that is enabled. If NULL, and tab_label is a CtkLabel or NULL, then the menu label will be a newly created label with the same text as tab_label ; if tab_label is not a CtkLabel, menu_label must be specified if the page-switch menu is to be used.

[allow-none]

Returns

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


ctk_notebook_insert_page ()

gint
ctk_notebook_insert_page (CtkNotebook *notebook,
                          CtkWidget *child,
                          CtkWidget *tab_label,
                          gint position);

Insert a page into notebook at the given position.

Parameters

notebook

a CtkNotebook

 

child

the CtkWidget to use as the contents of the page

 

tab_label

the CtkWidget to be used as the label for the page, or NULL to use the default label, “page N”.

[allow-none]

position

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

 

Returns

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


ctk_notebook_insert_page_menu ()

gint
ctk_notebook_insert_page_menu (CtkNotebook *notebook,
                               CtkWidget *child,
                               CtkWidget *tab_label,
                               CtkWidget *menu_label,
                               gint position);

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

Parameters

notebook

a CtkNotebook

 

child

the CtkWidget to use as the contents of the page

 

tab_label

the CtkWidget to be used as the label for the page, or NULL to use the default label, “page N”.

[allow-none]

menu_label

the widget to use as a label for the page-switch menu, if that is enabled. If NULL, and tab_label is a CtkLabel or NULL, then the menu label will be a newly created label with the same text as tab_label ; if tab_label is not a CtkLabel, menu_label must be specified if the page-switch menu is to be used.

[allow-none]

position

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

 

Returns

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


ctk_notebook_remove_page ()

void
ctk_notebook_remove_page (CtkNotebook *notebook,
                          gint page_num);

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

Parameters

notebook

a CtkNotebook

 

page_num

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

 

ctk_notebook_detach_tab ()

void
ctk_notebook_detach_tab (CtkNotebook *notebook,
                         CtkWidget *child);

Removes the child from the notebook.

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

Parameters

notebook

a CtkNotebook

 

child

a child

 

Since: 3.16


ctk_notebook_page_num ()

gint
ctk_notebook_page_num (CtkNotebook *notebook,
                       CtkWidget *child);

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

Parameters

notebook

a CtkNotebook

 

child

a CtkWidget

 

Returns

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


ctk_notebook_next_page ()

void
ctk_notebook_next_page (CtkNotebook *notebook);

Switches to the next page. Nothing happens if the current page is the last page.

Parameters

notebook

a CtkNotebook

 

ctk_notebook_prev_page ()

void
ctk_notebook_prev_page (CtkNotebook *notebook);

Switches to the previous page. Nothing happens if the current page is the first page.

Parameters

notebook

a CtkNotebook

 

ctk_notebook_reorder_child ()

void
ctk_notebook_reorder_child (CtkNotebook *notebook,
                            CtkWidget *child,
                            gint 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.

Parameters

notebook

a CtkNotebook

 

child

the child to move

 

position

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

 

ctk_notebook_set_tab_pos ()

void
ctk_notebook_set_tab_pos (CtkNotebook *notebook,
                          CtkPositionType pos);

Sets the edge at which the tabs for switching pages in the notebook are drawn.

Parameters

notebook

a CtkNotebook.

 

pos

the edge to draw the tabs at

 

ctk_notebook_set_show_tabs ()

void
ctk_notebook_set_show_tabs (CtkNotebook *notebook,
                            gboolean show_tabs);

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

Parameters

notebook

a CtkNotebook

 

show_tabs

TRUE if the tabs should be shown

 

ctk_notebook_set_show_border ()

void
ctk_notebook_set_show_border (CtkNotebook *notebook,
                              gboolean 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. See ctk_notebook_set_show_tabs().

Parameters

notebook

a CtkNotebook

 

show_border

TRUE if a bevel should be drawn around the notebook

 

ctk_notebook_set_scrollable ()

void
ctk_notebook_set_scrollable (CtkNotebook *notebook,
                             gboolean scrollable);

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

Parameters

notebook

a CtkNotebook

 

scrollable

TRUE if scroll arrows should be added

 

ctk_notebook_popup_enable ()

void
ctk_notebook_popup_enable (CtkNotebook *notebook);

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.

Parameters

notebook

a CtkNotebook

 

ctk_notebook_popup_disable ()

void
ctk_notebook_popup_disable (CtkNotebook *notebook);

Disables the popup menu.

Parameters

notebook

a CtkNotebook

 

ctk_notebook_get_current_page ()

gint
ctk_notebook_get_current_page (CtkNotebook *notebook);

Returns the page number of the current page.

Parameters

notebook

a CtkNotebook

 

Returns

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


ctk_notebook_get_menu_label ()

CtkWidget *
ctk_notebook_get_menu_label (CtkNotebook *notebook,
                             CtkWidget *child);

Retrieves the menu label widget of the page containing child .

Parameters

notebook

a CtkNotebook

 

child

a widget contained in a page of notebook

 

Returns

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

[nullable][transfer none]


ctk_notebook_get_nth_page ()

CtkWidget *
ctk_notebook_get_nth_page (CtkNotebook *notebook,
                           gint page_num);

Returns the child widget contained in page number page_num .

Parameters

notebook

a CtkNotebook

 

page_num

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

 

Returns

the child widget, or NULL if page_num is out of bounds.

[nullable][transfer none]


ctk_notebook_get_n_pages ()

gint
ctk_notebook_get_n_pages (CtkNotebook *notebook);

Gets the number of pages in a notebook.

Parameters

notebook

a CtkNotebook

 

Returns

the number of pages in the notebook

Since: 2.2


ctk_notebook_get_tab_label ()

CtkWidget *
ctk_notebook_get_tab_label (CtkNotebook *notebook,
                            CtkWidget *child);

Returns the tab label widget for the page child . NULL is returned if child is not in notebook or if no tab label has specifically been set for child .

Parameters

notebook

a CtkNotebook

 

child

the page

 

Returns

the tab label.

[transfer none][nullable]


ctk_notebook_set_menu_label ()

void
ctk_notebook_set_menu_label (CtkNotebook *notebook,
                             CtkWidget *child,
                             CtkWidget *menu_label);

Changes the menu label for the page containing child .

Parameters

notebook

a CtkNotebook

 

child

the child widget

 

menu_label

the menu label, or NULL for default.

[allow-none]

ctk_notebook_set_menu_label_text ()

void
ctk_notebook_set_menu_label_text (CtkNotebook *notebook,
                                  CtkWidget *child,
                                  const gchar *menu_text);

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

Parameters

notebook

a CtkNotebook

 

child

the child widget

 

menu_text

the label text

 

ctk_notebook_set_tab_label ()

void
ctk_notebook_set_tab_label (CtkNotebook *notebook,
                            CtkWidget *child,
                            CtkWidget *tab_label);

Changes the tab label for child . If NULL is specified for tab_label , then the page will have the label “page N”.

Parameters

notebook

a CtkNotebook

 

child

the page

 

tab_label

the tab label widget to use, or NULL for default tab label.

[allow-none]

ctk_notebook_set_tab_label_text ()

void
ctk_notebook_set_tab_label_text (CtkNotebook *notebook,
                                 CtkWidget *child,
                                 const gchar *tab_text);

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

Parameters

notebook

a CtkNotebook

 

child

the page

 

tab_text

the label text

 

ctk_notebook_set_tab_reorderable ()

void
ctk_notebook_set_tab_reorderable (CtkNotebook *notebook,
                                  CtkWidget *child,
                                  gboolean reorderable);

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

Parameters

notebook

a CtkNotebook

 

child

a child CtkWidget

 

reorderable

whether the tab is reorderable or not

 

Since: 2.10


ctk_notebook_set_tab_detachable ()

void
ctk_notebook_set_tab_detachable (CtkNotebook *notebook,
                                 CtkWidget *child,
                                 gboolean detachable);

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 ctk_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 “CTK_NOTEBOOK_TAB”. The notebook will fill the selection with a CtkWidget** pointing to the child widget that corresponds to the dropped tab.

Note that you should use ctk_notebook_detach_tab() instead of ctk_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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
static void
on_drag_data_received (CtkWidget        *widget,
                       CdkDragContext   *context,
                       gint              x,
                       gint              y,
                       CtkSelectionData *data,
                       guint             info,
                       guint             time,
                       gpointer          user_data)
{
  CtkWidget *notebook;
  CtkWidget **child;

  notebook = ctk_drag_get_source_widget (context);
  child = (void*) ctk_selection_data_get_data (data);

  // process_widget (*child);

  ctk_notebook_detach_tab (CTK_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.

Parameters

notebook

a CtkNotebook

 

child

a child CtkWidget

 

detachable

whether the tab is detachable or not

 

Since: 2.10


ctk_notebook_get_menu_label_text ()

const gchar *
ctk_notebook_get_menu_label_text (CtkNotebook *notebook,
                                  CtkWidget *child);

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

Parameters

notebook

a CtkNotebook

 

child

the child widget of a page of the notebook.

 

Returns

the text of the tab label, or NULL if the widget does not have a menu label other than the default menu label, or the menu label widget is not a CtkLabel. The string is owned by the widget and must not be freed.

[nullable]


ctk_notebook_get_scrollable ()

gboolean
ctk_notebook_get_scrollable (CtkNotebook *notebook);

Returns whether the tab label area has arrows for scrolling. See ctk_notebook_set_scrollable().

Parameters

notebook

a CtkNotebook

 

Returns

TRUE if arrows for scrolling are present


ctk_notebook_get_show_border ()

gboolean
ctk_notebook_get_show_border (CtkNotebook *notebook);

Returns whether a bevel will be drawn around the notebook pages. See ctk_notebook_set_show_border().

Parameters

notebook

a CtkNotebook

 

Returns

TRUE if the bevel is drawn


ctk_notebook_get_show_tabs ()

gboolean
ctk_notebook_get_show_tabs (CtkNotebook *notebook);

Returns whether the tabs of the notebook are shown. See ctk_notebook_set_show_tabs().

Parameters

notebook

a CtkNotebook

 

Returns

TRUE if the tabs are shown


ctk_notebook_get_tab_label_text ()

const gchar *
ctk_notebook_get_tab_label_text (CtkNotebook *notebook,
                                 CtkWidget *child);

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

Parameters

notebook

a CtkNotebook

 

child

a widget contained in a page of notebook

 

Returns

the text of the tab label, or NULL if the tab label widget is not a CtkLabel. The string is owned by the widget and must not be freed.

[nullable]


ctk_notebook_get_tab_pos ()

CtkPositionType
ctk_notebook_get_tab_pos (CtkNotebook *notebook);

Gets the edge at which the tabs for switching pages in the notebook are drawn.

Parameters

notebook

a CtkNotebook

 

Returns

the edge at which the tabs are drawn


ctk_notebook_get_tab_reorderable ()

gboolean
ctk_notebook_get_tab_reorderable (CtkNotebook *notebook,
                                  CtkWidget *child);

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

Parameters

notebook

a CtkNotebook

 

child

a child CtkWidget

 

Returns

TRUE if the tab is reorderable.

Since: 2.10


ctk_notebook_get_tab_detachable ()

gboolean
ctk_notebook_get_tab_detachable (CtkNotebook *notebook,
                                 CtkWidget *child);

Returns whether the tab contents can be detached from notebook .

Parameters

notebook

a CtkNotebook

 

child

a child CtkWidget

 

Returns

TRUE if the tab is detachable.

Since: 2.10


ctk_notebook_get_tab_hborder ()

guint16
ctk_notebook_get_tab_hborder (CtkNotebook *notebook);

ctk_notebook_get_tab_hborder has been deprecated since version 3.4 and should not be used in newly-written code.

this function returns zero

Returns the horizontal width of a tab border.

Parameters

notebook

a CtkNotebook

 

Returns

horizontal width of a tab border

Since: 2.22


ctk_notebook_get_tab_vborder ()

guint16
ctk_notebook_get_tab_vborder (CtkNotebook *notebook);

ctk_notebook_get_tab_vborder has been deprecated since version 3.4 and should not be used in newly-written code.

this function returns zero

Returns the vertical width of a tab border.

Parameters

notebook

a CtkNotebook

 

Returns

vertical width of a tab border

Since: 2.22


ctk_notebook_set_current_page ()

void
ctk_notebook_set_current_page (CtkNotebook *notebook,
                               gint page_num);

Switches to the page number page_num .

Note that due to historical reasons, CtkNotebook 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.

Parameters

notebook

a CtkNotebook

 

page_num

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.

 

ctk_notebook_set_group_name ()

void
ctk_notebook_set_group_name (CtkNotebook *notebook,
                             const gchar *group_name);

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 NULL group name will not be able to exchange tabs with any other notebook.

Parameters

notebook

a CtkNotebook

 

group_name

the name of the notebook group, or NULL to unset it.

[allow-none]

Since: 2.24


ctk_notebook_get_group_name ()

const gchar *
ctk_notebook_get_group_name (CtkNotebook *notebook);

Gets the current group name for notebook .

Parameters

notebook

a CtkNotebook

 

Returns

the group name, or NULL if none is set.

[nullable][transfer none]

Since: 2.24


ctk_notebook_set_action_widget ()

void
ctk_notebook_set_action_widget (CtkNotebook *notebook,
                                CtkWidget *widget,
                                CtkPackType 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 CtkBox 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 ctk_container_foreach().

Parameters

notebook

a CtkNotebook

 

widget

a CtkWidget

 

pack_type

pack type of the action widget

 

Since: 2.20


ctk_notebook_get_action_widget ()

CtkWidget *
ctk_notebook_get_action_widget (CtkNotebook *notebook,
                                CtkPackType pack_type);

Gets one of the action widgets. See ctk_notebook_set_action_widget().

Parameters

notebook

a CtkNotebook

 

pack_type

pack type of the action widget to receive

 

Returns

The action widget with the given pack_type or NULL when this action widget has not been set.

[nullable][transfer none]

Since: 2.20

Types and Values

struct CtkNotebook

struct CtkNotebook;

Property Details

The “enable-popup” property

  “enable-popup”             gboolean

If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page.

Owner: CtkNotebook

Flags: Read / Write

Default value: FALSE


The “group-name” property

  “group-name”               char *

Group name for tab drag and drop.

Owner: CtkNotebook

Flags: Read / Write

Default value: NULL

Since: 2.24


The “page” property

  “page”                     int

The index of the current page.

Owner: CtkNotebook

Flags: Read / Write

Allowed values: >= -1

Default value: -1


The “scrollable” property

  “scrollable”               gboolean

If TRUE, scroll arrows are added if there are too many tabs to fit.

Owner: CtkNotebook

Flags: Read / Write

Default value: FALSE


The “show-border” property

  “show-border”              gboolean

Whether the border should be shown.

Owner: CtkNotebook

Flags: Read / Write

Default value: TRUE


The “show-tabs” property

  “show-tabs”                gboolean

Whether tabs should be shown.

Owner: CtkNotebook

Flags: Read / Write

Default value: TRUE


The “tab-pos” property

  “tab-pos”                  CtkPositionType

Which side of the notebook holds the tabs.

Owner: CtkNotebook

Flags: Read / Write

Default value: CTK_POS_TOP

Signal Details

The “change-current-page” signal

gboolean
user_function (CtkNotebook *ctknotebook,
               int          arg1,
               gpointer     user_data)

Flags: Action


The “create-window” signal

CtkNotebook*
user_function (CtkNotebook *notebook,
               CtkWidget   *page,
               int          x,
               int          y,
               gpointer     user_data)

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 “group-name” ).

Parameters

notebook

the CtkNotebook emitting the signal

 

page

the tab of notebook that is being detached

 

x

the X coordinate where the drop happens

 

y

the Y coordinate where the drop happens

 

user_data

user data set when the signal handler was connected.

 

Returns

a CtkNotebook that page should be added to, or NULL.

[transfer none]

Flags: Run Last

Since: 2.12


The “focus-tab” signal

gboolean
user_function (CtkNotebook   *ctknotebook,
               CtkNotebookTab arg1,
               gpointer       user_data)

Flags: Action


The “move-focus-out” signal

void
user_function (CtkNotebook     *ctknotebook,
               CtkDirectionType arg1,
               gpointer         user_data)

Flags: Action


The “page-added” signal

void
user_function (CtkNotebook *notebook,
               CtkWidget   *child,
               guint        page_num,
               gpointer     user_data)

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

Parameters

notebook

the CtkNotebook

 

child

the child CtkWidget affected

 

page_num

the new page number for child

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 2.10


The “page-removed” signal

void
user_function (CtkNotebook *notebook,
               CtkWidget   *child,
               guint        page_num,
               gpointer     user_data)

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

Parameters

notebook

the CtkNotebook

 

child

the child CtkWidget affected

 

page_num

the child page number

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 2.10


The “page-reordered” signal

void
user_function (CtkNotebook *notebook,
               CtkWidget   *child,
               guint        page_num,
               gpointer     user_data)

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

Parameters

notebook

the CtkNotebook

 

child

the child CtkWidget affected

 

page_num

the new page number for child

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 2.10


The “reorder-tab” signal

gboolean
user_function (CtkNotebook     *ctknotebook,
               CtkDirectionType arg1,
               gboolean         arg2,
               gpointer         user_data)

Flags: Action


The “select-page” signal

gboolean
user_function (CtkNotebook *ctknotebook,
               gboolean     arg1,
               gpointer     user_data)

Flags: Action


The “switch-page” signal

void
user_function (CtkNotebook *notebook,
               CtkWidget   *page,
               guint        page_num,
               gpointer     user_data)

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

Parameters

notebook

the object which received the signal.

 

page

the new current page

 

page_num

the index of the page

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

See Also

CtkContainer