Gtk.Notebook

Entities

Simple Types

Tagged Types

Access Types

Constants

Subprograms

Generic Instantiations

Description

The Gtk.Notebook.Gtk_Notebook widget is a Gtk.Container.Gtk_Container 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 Gtk.Buildable.Gtk_Buildable interface supports placing children into tabs by specifying "tab" as the "type" attribute of a <child> element. Note that the content of the tab must be created before the tab can be filled. A tab child can be specified without specifying a <child> type attribute.

To add a child widget in the notebooks action area, specify "action-start" or "action-end" as the "type" attribute of the <child> element.

An example of a UI definition fragment with GtkNotebook:

<object class="GtkNotebook">
  <child>
    <object class="GtkLabel" id="notebook-content">
      <property name="label">Content</property>
    </object>
  </child>
  <child type="tab">
    <object class="GtkLabel" id="notebook-tab">
      <property name="label">Tab</property>
    </object>
  </child>
</object>

# CSS nodes

notebook
├── header.top
│   ├── [<action widget>]
│   ├── tabs
│   │   ├── [arrow]
│   │   ├── tab
│   │   │   ╰── <tab label>
┊   ┊   ┊
│   │   ├── tab[.reorderable-page]
│   │   │   ╰── <tab label>
│   │   ╰── [arrow]
│   ╰── [<action widget>]
│
╰── stack
    ├── <child>
    ┊
    ╰── <child>

GtkNotebook has a main CSS node with name notebook, a subnode with name header and below that a subnode with name tabs which contains one subnode per tab with name tab.

If action widgets are present, their CSS nodes are placed next to the tabs node. If the notebook is scrollable, CSS nodes with name arrow are placed as first and last child of the tabs node.

The main node gets the .frame style class when the notebook has a border (see 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.

<screenshot>gtk-notebook</screenshot> <group>Layout containers</group> <testgtk>create_notebook.adb</testgtk>

"+"

function "+"
  (Widget : access Gtk_Notebook_Record'Class)
return Gtk.Buildable.Gtk_Buildable
Parameters
Widget
Return Value

"-"

function "-"
  (Interf : Gtk.Buildable.Gtk_Buildable)
return Gtk_Notebook
Parameters
Interf
Return Value

Append_Page

function Append_Page
   (Notebook  : not null access Gtk_Notebook_Record;
    Child     : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
    return Glib.Gint

Appends a page to Notebook.

Parameters
Notebook
Child

the Gtk.Widget.Gtk_Widget to use as the contents of the page

Tab_Label

the Gtk.Widget.Gtk_Widget to be used as the label for the page, or null to use the default label, "page N"

Return Value

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

Append_Page

procedure Append_Page
  (Notebook  : access Gtk_Notebook_Record;
   Child     : access Gtk.Widget.Gtk_Widget_Record'Class)

Convenience functions, same as above but discarding the return value.

Parameters
Notebook
Child

Append_Page

procedure Append_Page
  (Notebook  : access Gtk_Notebook_Record;
   Child     : access Gtk.Widget.Gtk_Widget_Record'Class;
   Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)

Convenience functions, same as above but discarding the return value.

Parameters
Notebook
Child
Tab_Label

Append_Page_Menu

procedure Append_Page_Menu
   (Notebook   : not null access Gtk_Notebook_Record;
    Child      : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class;
    Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class)

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

Parameters
Notebook
Child

the Gtk.Widget.Gtk_Widget to use as the contents of the page

Tab_Label

the Gtk.Widget.Gtk_Widget to be used as the label for the page, or null to use the default label, "page N"

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 Gtk.Label.Gtk_Label 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 Gtk.Label.Gtk_Label, Menu_Label must be specified if the page-switch menu is to be used.

Cb_GObject_Boolean_Boolean

type Cb_GObject_Boolean_Boolean is not null access function
  (Self   : access Glib.Object.GObject_Record'Class;
   Object : Boolean) return Boolean;
Parameters
Self
Object
Return Value

Cb_GObject_Gint_Boolean

type Cb_GObject_Gint_Boolean is not null access function
  (Self   : access Glib.Object.GObject_Record'Class;
   Object : Glib.Gint) return Boolean;
Parameters
Self
Object
Return Value

Cb_GObject_Gtk_Direction_Type_Boolean_Boolean

type Cb_GObject_Gtk_Direction_Type_Boolean_Boolean is not null access function
  (Self   : access Glib.Object.GObject_Record'Class;
   Object : Gtk.Enums.Gtk_Direction_Type;
   P0     : Boolean) return Boolean;
Parameters
Self
Object
P0
Return Value

Cb_GObject_Gtk_Direction_Type_Void

type Cb_GObject_Gtk_Direction_Type_Void is not null access procedure
  (Self   : access Glib.Object.GObject_Record'Class;
   Object : Gtk.Enums.Gtk_Direction_Type);
Parameters
Self
Object

Cb_GObject_Gtk_Notebook_Tab_Boolean

type Cb_GObject_Gtk_Notebook_Tab_Boolean is not null access function
  (Self   : access Glib.Object.GObject_Record'Class;
   Object : Gtk_Notebook_Tab) return Boolean;
Parameters
Self
Object
Return Value

Cb_GObject_Gtk_Widget_Gint_Gint_Gtk_Notebook

type Cb_GObject_Gtk_Widget_Gint_Gint_Gtk_Notebook is not null access function
  (Self : access Glib.Object.GObject_Record'Class;
   Page : not null access Gtk.Widget.Gtk_Widget_Record'Class;
   X    : Glib.Gint;
   Y    : Glib.Gint) return Gtk_Notebook;
Parameters
Self
Page
X
Y
Return Value

Cb_GObject_Gtk_Widget_Guint_Void

type Cb_GObject_Gtk_Widget_Guint_Void is not null access procedure
  (Self     : access Glib.Object.GObject_Record'Class;
   Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class;
   Page_Num : Guint);
Parameters
Self
Child
Page_Num

Cb_Gtk_Notebook_Boolean_Boolean

type Cb_Gtk_Notebook_Boolean_Boolean is not null access function
  (Self   : access Gtk_Notebook_Record'Class;
   Object : Boolean) return Boolean;
Parameters
Self
Object
Return Value

Cb_Gtk_Notebook_Gint_Boolean

type Cb_Gtk_Notebook_Gint_Boolean is not null access function
  (Self   : access Gtk_Notebook_Record'Class;
   Object : Glib.Gint) return Boolean;
Parameters
Self
Object
Return Value

Cb_Gtk_Notebook_Gtk_Direction_Type_Boolean_Boolean

type Cb_Gtk_Notebook_Gtk_Direction_Type_Boolean_Boolean is not null access function
  (Self   : access Gtk_Notebook_Record'Class;
   Object : Gtk.Enums.Gtk_Direction_Type;
   P0     : Boolean) return Boolean;
Parameters
Self
Object
P0
Return Value

Cb_Gtk_Notebook_Gtk_Direction_Type_Void

type Cb_Gtk_Notebook_Gtk_Direction_Type_Void is not null access procedure
  (Self   : access Gtk_Notebook_Record'Class;
   Object : Gtk.Enums.Gtk_Direction_Type);
Parameters
Self
Object

Cb_Gtk_Notebook_Gtk_Notebook_Tab_Boolean

type Cb_Gtk_Notebook_Gtk_Notebook_Tab_Boolean is not null access function
  (Self   : access Gtk_Notebook_Record'Class;
   Object : Gtk_Notebook_Tab) return Boolean;
Parameters
Self
Object
Return Value

Cb_Gtk_Notebook_Gtk_Widget_Gint_Gint_Gtk_Notebook

type Cb_Gtk_Notebook_Gtk_Widget_Gint_Gint_Gtk_Notebook is not null access function
  (Self : access Gtk_Notebook_Record'Class;
   Page : not null access Gtk.Widget.Gtk_Widget_Record'Class;
   X    : Glib.Gint;
   Y    : Glib.Gint) return Gtk_Notebook;
Parameters
Self
Page
X
Y
Return Value

Cb_Gtk_Notebook_Gtk_Widget_Guint_Void

type Cb_Gtk_Notebook_Gtk_Widget_Guint_Void is not null access procedure
  (Self     : access Gtk_Notebook_Record'Class;
   Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class;
   Page_Num : Guint);
Parameters
Self
Child
Page_Num

Detach_Tab

procedure Detach_Tab
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class)

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. Since: gtk+ 3.16

Parameters
Notebook
Child

a child

Enable_Popup_Property

Enable_Popup_Property : constant Glib.Properties.Property_Boolean;

Get_Action_Widget

function Get_Action_Widget
   (Notebook  : not null access Gtk_Notebook_Record;
    Pack_Type : Gtk.Enums.Gtk_Pack_Type) return Gtk.Widget.Gtk_Widget

Gets one of the action widgets. See Gtk.Notebook.Set_Action_Widget. Since: gtk+ 2.20

Parameters
Notebook
Pack_Type

pack type of the action widget to receive

Return Value

The action widget with the given Pack_Type or null when this action widget has not been set

Get_Current_Page

function Get_Current_Page
   (Notebook : not null access Gtk_Notebook_Record) return Glib.Gint

Returns the page number of the current page.

Parameters
Notebook
Return Value

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

Get_Group_Name

function Get_Group_Name
   (Notebook : not null access Gtk_Notebook_Record) return UTF8_String

Gets the current group name for Notebook. Since: gtk+ 2.24

Parameters
Notebook
Return Value

the group name, or null if none is set

Get_Menu_Label

function Get_Menu_Label
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return Gtk.Widget.Gtk_Widget

Retrieves the menu label widget of the page containing Child.

Parameters
Notebook
Child

a widget contained in a page of Notebook

Return Value

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

Get_Menu_Label_Text

function Get_Menu_Label_Text
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return UTF8_String

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

Parameters
Notebook
Child

the child widget of a page of the notebook.

Return Value

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 Gtk.Label.Gtk_Label. The string is owned by the widget and must not be freed.

Get_N_Pages

function Get_N_Pages
   (Notebook : not null access Gtk_Notebook_Record) return Glib.Gint

Gets the number of pages in a notebook. Since: gtk+ 2.2

Parameters
Notebook
Return Value

the number of pages in the notebook

Get_Nth_Page

function Get_Nth_Page
   (Notebook : not null access Gtk_Notebook_Record;
    Page_Num : Glib.Gint) return Gtk.Widget.Gtk_Widget

Returns the child widget contained in page number Page_Num.

Parameters
Notebook
Page_Num

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

Return Value

the child widget, or null if Page_Num is out of bounds

Get_Scrollable

function Get_Scrollable
   (Notebook : not null access Gtk_Notebook_Record) return Boolean

Returns whether the tab label area has arrows for scrolling. See Gtk.Notebook.Set_Scrollable.

Parameters
Notebook
Return Value

True if arrows for scrolling are present

Get_Show_Border

function Get_Show_Border
   (Notebook : not null access Gtk_Notebook_Record) return Boolean

Returns whether a bevel will be drawn around the notebook pages. See Gtk.Notebook.Set_Show_Border.

Parameters
Notebook
Return Value

True if the bevel is drawn

Get_Show_Tabs

function Get_Show_Tabs
   (Notebook : not null access Gtk_Notebook_Record) return Boolean

Returns whether the tabs of the notebook are shown. See Gtk.Notebook.Set_Show_Tabs.

Parameters
Notebook
Return Value

True if the tabs are shown

Get_Tab_Detachable

function Get_Tab_Detachable
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return Boolean

Returns whether the tab contents can be detached from Notebook. Since: gtk+ 2.10

Parameters
Notebook
Child

a child Gtk.Widget.Gtk_Widget

Return Value

True if the tab is detachable.

Get_Tab_Hborder

function Get_Tab_Hborder
   (Notebook : not null access Gtk_Notebook_Record) return Guint16

Returns the horizontal width of a tab border. Since: gtk+ 2.22 Deprecated since 3.4, 1

Parameters
Notebook
Return Value

horizontal width of a tab border

Get_Tab_Label

function Get_Tab_Label
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return Gtk.Widget.Gtk_Widget

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
Child

the page

Return Value

the tab label

Get_Tab_Label_Text

function Get_Tab_Label_Text
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return UTF8_String

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

Parameters
Notebook
Child

a widget contained in a page of Notebook

Return Value

the text of the tab label, or null if the tab label widget is not a Gtk.Label.Gtk_Label. The string is owned by the widget and must not be freed.

Get_Tab_Pos

function Get_Tab_Pos
   (Notebook : not null access Gtk_Notebook_Record)
    return Gtk.Enums.Gtk_Position_Type

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

Parameters
Notebook
Return Value

the edge at which the tabs are drawn

Get_Tab_Reorderable

function Get_Tab_Reorderable
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return Boolean

Gets whether the tab can be reordered via drag and drop or not. Since: gtk+ 2.10

Parameters
Notebook
Child

a child Gtk.Widget.Gtk_Widget

Return Value

True if the tab is reorderable.

Get_Tab_Vborder

function Get_Tab_Vborder
   (Notebook : not null access Gtk_Notebook_Record) return Guint16

Returns the vertical width of a tab border. Since: gtk+ 2.22 Deprecated since 3.4, 1

Parameters
Notebook
Return Value

vertical width of a tab border

Get_Type

function Get_Type return Glib.GType
Return Value

Group_Name_Property

Group_Name_Property : constant Glib.Properties.Property_String;

Group name for tab drag and drop.

Gtk_New

procedure Gtk_New (Notebook : out Gtk_Notebook)

Creates a new Gtk.Notebook.Gtk_Notebook widget with no pages. Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Notebook

Gtk_Notebook

type Gtk_Notebook is access all Gtk_Notebook_Record'Class;

Gtk_Notebook_New

function Gtk_Notebook_New return Gtk_Notebook

Creates a new Gtk.Notebook.Gtk_Notebook widget with no pages.

Return Value

Gtk_Notebook_Record

type Gtk_Notebook_Record is new Gtk_Container_Record with null record;

Gtk_Notebook_Tab

type Gtk_Notebook_Tab is (
   Notebook_Tab_First,
   Notebook_Tab_Last);
Enumeration Literal
Notebook_Tab_First
Notebook_Tab_Last

Gtk_Notebook_Tab_Properties

package Gtk_Notebook_Tab_Properties is
   new Generic_Internal_Discrete_Property (Gtk_Notebook_Tab);

Implements_Gtk_Buildable

package Implements_Gtk_Buildable is new Glib.Types.Implements
  (Gtk.Buildable.Gtk_Buildable, Gtk_Notebook_Record, Gtk_Notebook);

Initialize

procedure Initialize
   (Notebook : not null access Gtk_Notebook_Record'Class)

Creates a new Gtk.Notebook.Gtk_Notebook widget with no pages. Initialize does nothing if the object was already created with another call to Initialize* or G_New.

Parameters
Notebook

Insert_Page

function Insert_Page
   (Notebook  : not null access Gtk_Notebook_Record;
    Child     : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class;
    Position  : Glib.Gint) return Glib.Gint

Insert a page into Notebook at the given position.

Parameters
Notebook
Child

the Gtk.Widget.Gtk_Widget to use as the contents of the page

Tab_Label

the Gtk.Widget.Gtk_Widget to be used as the label for the page, or null to use the default label, "page N"

Position

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

Return Value

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

Insert_Page_Menu

function Insert_Page_Menu
   (Notebook   : not null access Gtk_Notebook_Record;
    Child      : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class;
    Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class;
    Position   : Glib.Gint) return Glib.Gint

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

Parameters
Notebook
Child

the Gtk.Widget.Gtk_Widget to use as the contents of the page

Tab_Label

the Gtk.Widget.Gtk_Widget to be used as the label for the page, or null to use the default label, "page N"

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 Gtk.Label.Gtk_Label 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 Gtk.Label.Gtk_Label, Menu_Label must be specified if the page-switch menu is to be used.

Position

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

Return Value

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

Next_Page

procedure Next_Page (Notebook : not null access Gtk_Notebook_Record)

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

Parameters
Notebook

On_Change_Current_Page

procedure On_Change_Current_Page
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gint_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)
Parameters
Self
Call
Slot
After

On_Change_Current_Page

procedure On_Change_Current_Page
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gint_Boolean;
    After : Boolean := False)
Parameters
Self
Call
After

On_Create_Window

procedure On_Create_Window
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gtk_Widget_Gint_Gint_Gtk_Notebook;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

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 Gtk.Notebook.Gtk_Notebook:group-name ).

Callback parameters: -- @param Page the tab of Notebook that is being detached -- @param X the X coordinate where the drop happens -- @param Y the Y coordinate where the drop happens

Parameters
Self
Call
Slot
After

On_Create_Window

procedure On_Create_Window
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gtk_Widget_Gint_Gint_Gtk_Notebook;
    After : Boolean := False)

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 Gtk.Notebook.Gtk_Notebook:group-name ).

Callback parameters: -- @param Page the tab of Notebook that is being detached -- @param X the X coordinate where the drop happens -- @param Y the Y coordinate where the drop happens

Parameters
Self
Call
After

On_Focus_Tab

procedure On_Focus_Tab
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gtk_Notebook_Tab_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)
Parameters
Self
Call
Slot
After

On_Focus_Tab

procedure On_Focus_Tab
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gtk_Notebook_Tab_Boolean;
    After : Boolean := False)
Parameters
Self
Call
After

On_Move_Focus_Out

procedure On_Move_Focus_Out
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gtk_Direction_Type_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)
Parameters
Self
Call
Slot
After

On_Move_Focus_Out

procedure On_Move_Focus_Out
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gtk_Direction_Type_Void;
    After : Boolean := False)
Parameters
Self
Call
After

On_Page_Added

procedure On_Page_Added
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gtk_Widget_Guint_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the new page number for Child

Parameters
Self
Call
Slot
After

On_Page_Added

procedure On_Page_Added
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gtk_Widget_Guint_Void;
    After : Boolean := False)

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the new page number for Child

Parameters
Self
Call
After

On_Page_Removed

procedure On_Page_Removed
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gtk_Widget_Guint_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the Child page number

Parameters
Self
Call
Slot
After

On_Page_Removed

procedure On_Page_Removed
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gtk_Widget_Guint_Void;
    After : Boolean := False)

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the Child page number

Parameters
Self
Call
After

On_Page_Reordered

procedure On_Page_Reordered
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gtk_Widget_Guint_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the new page number for Child

Parameters
Self
Call
Slot
After

On_Page_Reordered

procedure On_Page_Reordered
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gtk_Widget_Guint_Void;
    After : Boolean := False)

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the new page number for Child

Parameters
Self
Call
After

On_Reorder_Tab

procedure On_Reorder_Tab
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gtk_Direction_Type_Boolean_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

Callback parameters:

Parameters
Self
Call
Slot
After

On_Reorder_Tab

procedure On_Reorder_Tab
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gtk_Direction_Type_Boolean_Boolean;
    After : Boolean := False)

Callback parameters:

Parameters
Self
Call
After

On_Select_Page

procedure On_Select_Page
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Boolean_Boolean;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)
Parameters
Self
Call
Slot
After

On_Select_Page

procedure On_Select_Page
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Boolean_Boolean;
    After : Boolean := False)
Parameters
Self
Call
After

On_Switch_Page

procedure On_Switch_Page
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_GObject_Gtk_Widget_Guint_Void;
    Slot  : not null access Glib.Object.GObject_Record'Class;
    After : Boolean := False)

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

Callback parameters: -- @param Page the new current page -- @param Page_Num the index of the page

Parameters
Self
Call
Slot
After

On_Switch_Page

procedure On_Switch_Page
   (Self  : not null access Gtk_Notebook_Record;
    Call  : Cb_Gtk_Notebook_Gtk_Widget_Guint_Void;
    After : Boolean := False)

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

Callback parameters: -- @param Page the new current page -- @param Page_Num the index of the page

Parameters
Self
Call
After

Page_Num

function Page_Num
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class)
    return Glib.Gint

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

Parameters
Notebook
Child

a Gtk.Widget.Gtk_Widget

Return Value

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

Page_Property

Page_Property : constant Glib.Properties.Property_Int;

Popup_Disable

procedure Popup_Disable (Notebook : not null access Gtk_Notebook_Record)

Disables the popup menu.

Parameters
Notebook

Popup_Enable

procedure Popup_Enable (Notebook : not null access Gtk_Notebook_Record)

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

Prepend_Page

function Prepend_Page
   (Notebook  : not null access Gtk_Notebook_Record;
    Child     : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
    return Glib.Gint

Prepends a page to Notebook.

Parameters
Notebook
Child

the Gtk.Widget.Gtk_Widget to use as the contents of the page

Tab_Label

the Gtk.Widget.Gtk_Widget to be used as the label for the page, or null to use the default label, "page N"

Return Value

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

Prepend_Page

procedure Prepend_Page
  (Notebook  : access Gtk_Notebook_Record;
   Child     : access Gtk.Widget.Gtk_Widget_Record'Class;
   Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)

Convenience functions, same as above but discarding the return value.

Parameters
Notebook
Child
Tab_Label

Prepend_Page_Menu

function Prepend_Page_Menu
   (Notebook   : not null access Gtk_Notebook_Record;
    Child      : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Tab_Label  : access Gtk.Widget.Gtk_Widget_Record'Class;
    Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class)
    return Glib.Gint

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

Parameters
Notebook
Child

the Gtk.Widget.Gtk_Widget to use as the contents of the page

Tab_Label

the Gtk.Widget.Gtk_Widget to be used as the label for the page, or null to use the default label, "page N"

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 Gtk.Label.Gtk_Label 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 Gtk.Label.Gtk_Label, Menu_Label must be specified if the page-switch menu is to be used.

Return Value

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

Prev_Page

procedure Prev_Page (Notebook : not null access Gtk_Notebook_Record)

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

Parameters
Notebook

Property_Gtk_Notebook_Tab

type Property_Gtk_Notebook_Tab is new Gtk_Notebook_Tab_Properties.Property;

Remove_Page

procedure Remove_Page
   (Notebook : not null access Gtk_Notebook_Record;
    Page_Num : Glib.Gint)

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

Parameters
Notebook
Page_Num

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

Reorder_Child

procedure Reorder_Child
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Position : Glib.Gint)

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
Child

the child to move

Position

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

Scrollable_Property

Scrollable_Property : constant Glib.Properties.Property_Boolean;

Set_Action_Widget

procedure Set_Action_Widget
   (Notebook  : not null access Gtk_Notebook_Record;
    Widget    : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Pack_Type : Gtk.Enums.Gtk_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 Gtk.Box.Gtk_Box 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. Since: gtk+ 2.20

Parameters
Notebook
Widget

a Gtk.Widget.Gtk_Widget

Pack_Type

pack type of the action widget

Set_Current_Page

procedure Set_Current_Page
   (Notebook : not null access Gtk_Notebook_Record;
    Page_Num : Glib.Gint := -1)

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.

Parameters
Notebook
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.

Set_Group_Name

procedure Set_Group_Name
   (Notebook   : not null access Gtk_Notebook_Record;
    Group_Name : UTF8_String := "")

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. Since: gtk+ 2.24

Parameters
Notebook
Group_Name

the name of the notebook group, or null to unset it

Set_Menu_Label

procedure Set_Menu_Label
   (Notebook   : not null access Gtk_Notebook_Record;
    Child      : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Menu_Label : access Gtk.Widget.Gtk_Widget_Record'Class)

Changes the menu label for the page containing Child.

Parameters
Notebook
Child

the child widget

Menu_Label

the menu label, or null for default

Set_Menu_Label_Text

procedure Set_Menu_Label_Text
   (Notebook  : not null access Gtk_Notebook_Record;
    Child     : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Menu_Text : UTF8_String)

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

Parameters
Notebook
Child

the child widget

Menu_Text

the label text

Set_Scrollable

procedure Set_Scrollable
   (Notebook   : not null access Gtk_Notebook_Record;
    Scrollable : Boolean := True)

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

Parameters
Notebook
Scrollable

True if scroll arrows should be added

Set_Show_Border

procedure Set_Show_Border
   (Notebook    : not null access Gtk_Notebook_Record;
    Show_Border : Boolean := True)

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.

Parameters
Notebook
Show_Border

True if a bevel should be drawn around the notebook

Set_Show_Tabs

procedure Set_Show_Tabs
   (Notebook  : not null access Gtk_Notebook_Record;
    Show_Tabs : Boolean := True)

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

Parameters
Notebook
Show_Tabs

True if the tabs should be shown

Set_Tab_Detachable

procedure Set_Tab_Detachable
   (Notebook   : not null access Gtk_Notebook_Record;
    Child      : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Detachable : Boolean := True)

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 of Gtk.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.

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. Since: gtk+ 2.10

Parameters
Notebook
Child

a child Gtk.Widget.Gtk_Widget

Detachable

whether the tab is detachable or not

Set_Tab_Label

procedure Set_Tab_Label
   (Notebook  : not null access Gtk_Notebook_Record;
    Child     : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Tab_Label : access Gtk.Widget.Gtk_Widget_Record'Class)

Changes the tab label for Child. If null is specified for Tab_Label, then the page will have the label "page N".

Parameters
Notebook
Child

the page

Tab_Label

the tab label widget to use, or null for default tab label

Set_Tab_Label_Text

procedure Set_Tab_Label_Text
   (Notebook : not null access Gtk_Notebook_Record;
    Child    : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Tab_Text : UTF8_String)

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

Parameters
Notebook
Child

the page

Tab_Text

the label text

Set_Tab_Pos

procedure Set_Tab_Pos
   (Notebook : not null access Gtk_Notebook_Record;
    Pos      : Gtk.Enums.Gtk_Position_Type)

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

Parameters
Notebook
Pos

the edge to draw the tabs at

Set_Tab_Reorderable

procedure Set_Tab_Reorderable
   (Notebook    : not null access Gtk_Notebook_Record;
    Child       : not null access Gtk.Widget.Gtk_Widget_Record'Class;
    Reorderable : Boolean := True)

Sets whether the notebook tab can be reordered via drag and drop or not. Since: gtk+ 2.10

Parameters
Notebook
Child

a child Gtk.Widget.Gtk_Widget

Reorderable

whether the tab is reorderable or not

Show_Border_Property

Show_Border_Property : constant Glib.Properties.Property_Boolean;

Show_Tabs_Property

Show_Tabs_Property : constant Glib.Properties.Property_Boolean;

Signal_Change_Current_Page

Signal_Change_Current_Page : constant Glib.Signal_Name := "change-current-page";

Signal_Create_Window

Signal_Create_Window : constant Glib.Signal_Name := "create-window";

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 Gtk.Notebook.Gtk_Notebook:group-name ).

Callback parameters: -- @param Page the tab of Notebook that is being detached -- @param X the X coordinate where the drop happens -- @param Y the Y coordinate where the drop happens

Signal_Focus_Tab

Signal_Focus_Tab : constant Glib.Signal_Name := "focus-tab";

Signal_Move_Focus_Out

Signal_Move_Focus_Out : constant Glib.Signal_Name := "move-focus-out";

Signal_Page_Added

Signal_Page_Added : constant Glib.Signal_Name := "page-added";

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the new page number for Child

Signal_Page_Removed

Signal_Page_Removed : constant Glib.Signal_Name := "page-removed";

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the Child page number

Signal_Page_Reordered

Signal_Page_Reordered : constant Glib.Signal_Name := "page-reordered";

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

Callback parameters: -- @param Child the child Gtk.Widget.Gtk_Widget affected -- @param Page_Num the new page number for Child

Signal_Reorder_Tab

Signal_Reorder_Tab : constant Glib.Signal_Name := "reorder-tab";

Callback parameters:

Signal_Select_Page

Signal_Select_Page : constant Glib.Signal_Name := "select-page";

Signal_Switch_Page

Signal_Switch_Page : constant Glib.Signal_Name := "switch-page";

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

Callback parameters: -- @param Page the new current page -- @param Page_Num the index of the page

Tab_Pos_Property

Tab_Pos_Property : constant Gtk.Enums.Property_Gtk_Position_Type;