gtkmm 2.4: Gtk::Notebook Class Reference

Main Page Widgets Namespaces Book

# Gtk::Notebook Class Reference
[Widgets, Container Widgets]

Inheritance diagram for Gtk::Notebook:

[legend]
List of all members.

## Detailed Description

Container which shows one of its children at a time, in tabbed windows.

The Gtk::Notebook widget is a Gtk::Container whose children are pages that can be switched between using tab labels along one edge.

You can use the PageList returned by pages() as any normal STL container to manipulate the pages.

A Notebook widget looks like this:

## Public Types
typedef Notebook_Helpers::PageList | PageList
typedef sigc::slot< Notebook*, Widget*, int, int > | SlotWindowCreation
| For instance, Notebook* on_window_creation(Widget* page, int x, int y);.
## Public Member Functions
int | append_page (Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, bool use_mnemonic=false)
int | append_page (Widget& child, Widget& tab_label, Widget& menu_label)
| Appends a page to notebook, specifying the widget to use as the label in the popup menu.
int | append_page (Widget& child, const Glib::ustring& tab_label, bool use_mnemonic=false)
int | append_page (Widget& child)
int | append_page (Widget& child, Widget& tab_label)
| Appends a page to notebook.
PageList::iterator | get_current ()
int | get_current_page () const
| Return value: the index (starting from 0) of the current.
const void* | get_group () const
| Gets the current group identificator pointer for notebook.
void* | get_group ()
| Gets the current group identificator pointer for notebook.
int | get_group_id () const
| Gets the current group identificator for notebook.
const Widget* | get_menu_label (Widget& child) const
| Retrieves the menu label widget of the page containing child.
Widget* | get_menu_label (Widget& child)
| Retrieves the menu label widget of the page containing child.
Glib::ustring | get_menu_label_text (Widget& child) const
| Retrieves the text of the menu label for the page containing child.
int | get_n_pages () const
| Gets the number of pages in a notebook.
int | get_n_pages ()
| Gets the number of pages in a notebook.
const Widget* | get_nth_page (int page_num) const
| Return value: the child widget, or `0` if page_num is.
Widget* | get_nth_page (int page_num)
| Return value: the child widget, or `0` if page_num is.
bool | get_scrollable () const
| Return value: `true` if arrows for scrolling are present.
bool | get_show_border () const
| Return value: `true` if the bevel is drawn.
bool | get_show_tabs () const
| Return value: `true` if the tabs are shown.
bool | get_tab_detachable (Widget& child) const
| Return Value: `true` if the tab is detachable.
const Widget* | get_tab_label (Widget& child) const
| Return value: the tab label.
Widget* | get_tab_label (Widget& child)
| Return value: the tab label.
Glib::ustring | get_tab_label_text (Widget& child) const
| Retrieves the text of the tab label for the page containing child.
PositionType | get_tab_pos () const
| Gets the edge at which the tabs for switching pages in the notebook are drawn.
bool | get_tab_reorderable (Widget& child) const
| Gets whether the tab can be reordered via drag and drop or not.
const GtkNotebook* | gobj () const
| Provides access to the underlying C GtkObject.
GtkNotebook* | gobj ()
| Provides access to the underlying C GtkObject.
int | insert_page (Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, int position, bool use_mnemonic=false)
int | insert_page (Widget& child, Widget& tab_label, Widget& menu_label, int position)
| Insert a page into notebook at the given position, specifying the widget to use as the label in the popup menu.
int | insert_page (Widget& child, const Glib::ustring& tab_label, int position, bool use_mnemonic=false)
int | insert_page (Widget& child, int position)
int | insert_page (Widget& child, Widget& tab_label, int position)
| Insert a page into notebook at the given position.
void | next_page ()
| Switches to the next page.
| Notebook ()
int | page_num (const Widget& child) const
| Finds the index of the page which contains the given child widget.
int | page_num (const Widget& child)
| Finds the index of the page which contains the given child widget.
const PageList& | pages () const
PageList& | pages ()
void | popup_disable ()
| Disables the popup menu.
void | popup_enable ()
| Enables the popup menu: if the user clicks with the right mouse button on the bookmarks, a menu with all the pages will be popped up.
int | prepend_page (Widget& child, const Glib::ustring& tab_label, const Glib::ustring& menu_label, bool use_mnemonic)
int | prepend_page (Widget& child, Widget& tab_label, Widget& menu_label)
| Prepends a page to notebook, specifying the widget to use as the label in the popup menu.
int | prepend_page (Widget& child, const Glib::ustring& tab_label, bool use_mnemonic=false)
int | prepend_page (Widget& child)
int | prepend_page (Widget& child, Widget& tab_label)
| Prepends a page to notebook.
void | prev_page ()
| Switches to the previous page.
Glib::PropertyProxy_ReadOnly< bool > | property_enable_popup () const
| If TRUE.
Glib::PropertyProxy<bool> | property_enable_popup ()
| If TRUE.
Glib::PropertyProxy_ReadOnly< bool > | property_homogeneous () const
| Whether tabs should have homogeneous sizes.
Glib::PropertyProxy<bool> | property_homogeneous ()
| Whether tabs should have homogeneous sizes.
Glib::PropertyProxy_ReadOnly< int > | property_page () const
| The index of the current page.
Glib::PropertyProxy<int> | property_page ()
| The index of the current page.
Glib::PropertyProxy_ReadOnly< bool > | property_scrollable () const
| If TRUE.
Glib::PropertyProxy<bool> | property_scrollable ()
| If TRUE.
Glib::PropertyProxy_ReadOnly< bool > | property_show_border () const
| Whether the border should be shown or not.
Glib::PropertyProxy<bool> | property_show_border ()
| Whether the border should be shown or not.
Glib::PropertyProxy_ReadOnly< bool > | property_show_tabs () const
| Whether tabs should be shown or not.
Glib::PropertyProxy<bool> | property_show_tabs ()
| Whether tabs should be shown or not.
Glib::PropertyProxy_WriteOnly< guint > | property_tab_border ()
| Width of the border around the tab labels.
Glib::PropertyProxy_ReadOnly< guint > | property_tab_hborder () const
| Width of the horizontal border of tab labels.
Glib::PropertyProxy<guint> | property_tab_hborder ()
| Width of the horizontal border of tab labels.
Glib::PropertyProxy_ReadOnly< PositionType > | property_tab_pos () const
| Which side of the notebook holds the tabs.
Glib::PropertyProxy<PositionType> | property_tab_pos ()
| Which side of the notebook holds the tabs.
Glib::PropertyProxy_ReadOnly< guint > | property_tab_vborder () const
| Width of the vertical border of tab labels.
Glib::PropertyProxy<guint> | property_tab_vborder ()
| Width of the vertical border of tab labels.
void | query_tab_label_packing (Widget& child, bool& expand, bool& fill, PackType& pack_type)
void | remove_page (Widget& child)
void | remove_page (int page_num=0)
| Removes a page from the notebook given its index in the notebook.
void | reorder_child (Widget& child, int position)
| Reorders the page containing child, so that it appears in position position.
void | set_current_page (int page_num)
| Switches to the page number page_num.
void | set_group (void* group)
| Sets a group identificator pointer for notebook, notebooks sharing the same group identificator pointer will be able to exchange tabs via drag and drop.
void | set_group_id (int group_id)
| Sets an group identificator for notebook, notebooks sharing the same group identificator will be able to exchange tabs via drag and drop.
void | set_menu_label (Widget& child, Widget& menu_label)
| Changes the menu label for the page containing child.
void | set_menu_label_text (Widget& child, const Glib::ustring& menu_text)
| Creates a new label and sets it as the menu label of child.
void | set_scrollable (bool scrollable=true)
| Sets whether the tab label area will have arrows for scrolling if there are too many tabs to fit in the area.
void | set_show_border (bool show_border=true)
| Sets whether a bevel will be drawn around the notebook pages.
void | set_show_tabs (bool show_tabs=true)
| Sets whether to show the tabs for the notebook or not.
void | set_tab_detachable (Widget& child, bool detachable=true)
| Sets whether the tab can be detached from notebook to another notebook or widget.
void | set_tab_label (Widget& child, Widget& tab_label)
| Changes the tab label for child.
void | set_tab_label_packing (Widget& child, bool expand, bool fill, PackType pack_type)
| Sets the packing parameters for the tab label of the page containing child.
void | set_tab_label_text (Widget& child, const Glib::ustring& tab_text)
| Creates a new label and sets it as the tab label for the page containing child.
void | set_tab_pos (PositionType pos)
| Sets the edge at which the tabs for switching pages in the notebook are drawn.
void | set_tab_reorderable (Widget& child, bool reorderable=true)
| Sets whether the notebook tab can be reordered via drag and drop or not.
Glib::SignalProxy2< void, Widget*, guint > | signal_page_added ()
| Prototype: `void on_my_page_added(Widget* page, guint page_num)`
Glib::SignalProxy2< void, Widget*, guint > | signal_page_removed ()
| Prototype: `void on_my_page_removed(Widget* page, guint page_num)`
Glib::SignalProxy2< void, Widget*, guint > | signal_page_reordered ()
| Prototype: `void on_my_page_reordered(Widget* page, guint page_num)`
Glib::SignalProxy2< void, GtkNotebookPage*, guint > | signal_switch_page ()
| Prototype: `void on_my_switch_page(GtkNotebookPage* page, guint page_num)`
virtual | ~Notebook ()
## Static Public Member Functions
static void | set_window_creation_hook (const SlotWindowCreation& slot)
## Protected Member Functions
virtual void | on_switch_page (GtkNotebookPage* page, guint page_num)
## Related Functions
(Note that these are not member functions.)
Gtk::Notebook* | wrap (GtkNotebook* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Member Typedef Documentation

typedef Notebook_Helpers::PageList Gtk::Notebook::PageList

typedef sigc::slot<Notebook*, Widget*, int, int> Gtk::Notebook::SlotWindowCreation

For instance, Notebook* on_window_creation(Widget* page, int x, int y);.

## Constructor & Destructor Documentation

virtual Gtk::Notebook::~Notebook | ( |  | ) | `[virtual]`

Gtk::Notebook::Notebook | ( |  | ) |

## Member Function Documentation

int Gtk::Notebook::append_page | ( | Widget& | child,
|  | const Glib::ustring & | tab_label,
|  | const Glib::ustring & | menu_label,
|  | bool | use_mnemonic = `false` |
| ) |  |  |

int Gtk::Notebook::append_page | ( | Widget& | child,
|  | Widget& | tab_label,
|  | Widget& | menu_label |
| ) |  |  |

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

Parameters:

  | child | The Gtk::Widget to use as the contents of the page.
  | tab_label | The Gtk::Widget to be used as the label for the page.
  | menu_label | The widget to use as a label for the page-switch menu.

int Gtk::Notebook::append_page | ( | Widget& | child,
|  | const Glib::ustring & | tab_label,
|  | bool | use_mnemonic = `false` |
| ) |  |  |

int Gtk::Notebook::append_page | ( | Widget& | child | ) |

int Gtk::Notebook::append_page | ( | Widget& | child,
|  | Widget& | tab_label |
| ) |  |  |

Appends a page to notebook.

Parameters:

  | child | The Gtk::Widget to use as the contents of the page.
  | tab_label | The Gtk::Widget to be used as the label for the page.

PageList::iterator Gtk::Notebook::get_current | ( |  | ) |

int Gtk::Notebook::get_current_page | ( |  | ) | const

Return value: the index (starting from 0) of the current.

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

const void* Gtk::Notebook::get_group | ( |  | ) | const

Gets the current group identificator pointer for notebook.

Returns:
  The group identificator, or `0` if none is set.

Since gtkmm 2.12:

void* Gtk::Notebook::get_group | ( |  | ) |

Gets the current group identificator pointer for notebook.

Returns:
  The group identificator, or `0` if none is set.

Since gtkmm 2.12:

int Gtk::Notebook::get_group_id | ( |  | ) | const

Gets the current group identificator for notebook.

Returns:
  The group identificator, or -1 if none is set.

Since gtkmm 2.10:

Deprecated:2.12: use get_group() instead.

const Widget* Gtk::Notebook::get_menu_label | ( | Widget& | child | ) | const

Retrieves the menu label widget of the page containing child.

Parameters:

  | child | A widget contained in a page of notebook.

Returns:
  The menu label, or `0` if the notebook page does not have a menu label other than the default (the tab label).

Widget* Gtk::Notebook::get_menu_label | ( | Widget& | child | ) |

Retrieves the menu label widget of the page containing child.

Parameters:

  | child | A widget contained in a page of notebook.

Returns:
  The menu label, or `0` if the notebook page does not have a menu label other than the default (the tab label).

Glib::ustring Gtk::Notebook::get_menu_label_text | ( | Widget& | child | ) | const

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

Parameters:

  | child | The child widget of a page of the notebook.

Returns:
  Value: the text of the tab label.

int Gtk::Notebook::get_n_pages | ( |  | ) | const

Gets the number of pages in a notebook.

Returns:
  The number of pages in the notebook.

Since gtkmm 2.2:

int Gtk::Notebook::get_n_pages | ( |  | ) |

Gets the number of pages in a notebook.

Deprecated:
  Use the const method.

Returns:
  The number of pages in the notebook.

Since gtkmm 2.2:

const Widget* Gtk::Notebook::get_nth_page | ( | int | page_num | ) | const

Return value: the child widget, or `0` if page_num is.

Parameters:

  | page_num | The index of a page in the notebook, or -1 to get the last page.

Returns:
  The child widget, or `0` if page_num is out of bounds.

Widget* Gtk::Notebook::get_nth_page | ( | int | page_num | ) |

Return value: the child widget, or `0` if page_num is.

Parameters:

  | page_num | The index of a page in the notebook, or -1 to get the last page.

Returns:
  The child widget, or `0` if page_num is out of bounds.

bool Gtk::Notebook::get_scrollable | ( |  | ) | const

Return value: `true` if arrows for scrolling are present.

Returns:
  `true` if arrows for scrolling are present.

bool Gtk::Notebook::get_show_border | ( |  | ) | const

Return value: `true` if the bevel is drawn.

Returns:
  `true` if the bevel is drawn.

bool Gtk::Notebook::get_show_tabs | ( |  | ) | const

Return value: `true` if the tabs are shown.

Returns:
  `true` if the tabs are shown.

bool Gtk::Notebook::get_tab_detachable | ( | Widget& | child | ) | const

Return Value: `true` if the tab is detachable.

Parameters:

  | child | A child Gtk::Widget.

Returns:
  `true` if the tab is detachable.

Since gtkmm 2.10:

const Widget* Gtk::Notebook::get_tab_label | ( | Widget& | child | ) | const

Return value: the tab label.

Parameters:

  | child | The page.

Returns:
  The tab label.

Widget* Gtk::Notebook::get_tab_label | ( | Widget& | child | ) |

Return value: the tab label.

Parameters:

  | child | The page.

Returns:
  The tab label.

Glib::ustring Gtk::Notebook::get_tab_label_text | ( | Widget& | child | ) | const

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

Parameters:

  | child | A widget contained in a page of notebook.

Returns:
  Value: the text of the tab label.

PositionType Gtk::Notebook::get_tab_pos | ( |  | ) | const

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

Returns:
  The edge at which the tabs are drawn.

bool Gtk::Notebook::get_tab_reorderable | ( | Widget& | child | ) | const

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

Parameters:

  | child | A child Gtk::Widget.

Returns:
  `true` if the tab is reorderable.

Since gtkmm 2.10:

const GtkNotebook* Gtk::Notebook::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

GtkNotebook* Gtk::Notebook::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Container.

int Gtk::Notebook::insert_page | ( | Widget& | child,
|  | const Glib::ustring & | tab_label,
|  | const Glib::ustring & | menu_label,
|  | int | position,
|  | bool | use_mnemonic = `false` |
| ) |  |  |

int Gtk::Notebook::insert_page | ( | Widget& | child,
|  | Widget& | tab_label,
|  | Widget& | menu_label,
|  | int | position |
| ) |  |  |

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

Parameters:

  | child | The Gtk::Widget to use as the contents of the page.
  | tab_label | The Gtk::Widget to be used as the label for the page..
  | menu_label | The widget to use as a label for the page-switch menu.
  | position | The index (starting at 0) at which to insert the page, or -1 to append the page after all other pages.

int Gtk::Notebook::insert_page | ( | Widget& | child,
|  | const Glib::ustring & | tab_label,
|  | int | position,
|  | bool | use_mnemonic = `false` |
| ) |  |  |

int Gtk::Notebook::insert_page | ( | Widget& | child,
|  | int | position |
| ) |  |  |

int Gtk::Notebook::insert_page | ( | Widget& | child,
|  | Widget& | tab_label,
|  | int | position |
| ) |  |  |

Insert a page into notebook at the given position.

Parameters:

  | child | The Gtk::Widget to use as the contents of the page.
  | tab_label | The Gtk::Widget to be used as the label for the page.
  | position | The index (starting at 0) at which to insert the page, or -1 to append the page after all other pages.

void Gtk::Notebook::next_page | ( |  | ) |

Switches to the next page.

Nothing happens if the current page is the last page.

virtual void Gtk::Notebook::on_switch_page | ( | GtkNotebookPage * | page,
|  | guint | page_num |
| ) |  |  | `[protected, virtual]`

int Gtk::Notebook::page_num | ( | const Widget& | child | ) | const

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

Parameters:

  | child | A Gtk::Widget.

Returns:
  The index of the page containing child, or -1 if child is not in the notebook.

int Gtk::Notebook::page_num | ( | const Widget& | child | ) |

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

Deprecated:
  Use the const method.

Parameters:

  | child | A Gtk::Widget.

Returns:
  The index of the page containing child, or -1 if child is not in the notebook.

const PageList& Gtk::Notebook::pages | ( |  | ) | const

PageList& Gtk::Notebook::pages | ( |  | ) |

void Gtk::Notebook::popup_disable | ( |  | ) |

Disables the popup menu.

void Gtk::Notebook::popup_enable | ( |  | ) |

Enables the popup menu: if the user clicks with the right mouse button on the bookmarks, a menu with all the pages will be popped up.

int Gtk::Notebook::prepend_page | ( | Widget& | child,
|  | const Glib::ustring & | tab_label,
|  | const Glib::ustring & | menu_label,
|  | bool | use_mnemonic |
| ) |  |  |

int Gtk::Notebook::prepend_page | ( | Widget& | child,
|  | Widget& | tab_label,
|  | Widget& | menu_label |
| ) |  |  |

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

Parameters:

  | child | The Gtk::Widget to use as the contents of the page.
  | tab_label | The Gtk::Widget to be used as the label for the page.
  | menu_label | The widget to use as a label for the page-switch menu.

int Gtk::Notebook::prepend_page | ( | Widget& | child,
|  | const Glib::ustring & | tab_label,
|  | bool | use_mnemonic = `false` |
| ) |  |  |

int Gtk::Notebook::prepend_page | ( | Widget& | child | ) |

int Gtk::Notebook::prepend_page | ( | Widget& | child,
|  | Widget& | tab_label |
| ) |  |  |

Prepends a page to notebook.

Parameters:

  | child | The Gtk::Widget to use as the contents of the page.
  | tab_label | The Gtk::Widget to be used as the label for the page.

void Gtk::Notebook::prev_page | ( |  | ) |

Switches to the previous page.

Nothing happens if the current page is the first page.

Glib::PropertyProxy_ReadOnly<bool> Gtk::Notebook::property_enable_popup | ( |  | ) | const

If TRUE.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::Notebook::property_enable_popup | ( |  | ) |

If TRUE.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::Notebook::property_homogeneous | ( |  | ) | const

Whether tabs should have homogeneous sizes.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::Notebook::property_homogeneous | ( |  | ) |

Whether tabs should have homogeneous sizes.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::Notebook::property_page | ( |  | ) | const

The index of the current page.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<int> Gtk::Notebook::property_page | ( |  | ) |

The index of the current page.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::Notebook::property_scrollable | ( |  | ) | const

If TRUE.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::Notebook::property_scrollable | ( |  | ) |

If TRUE.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::Notebook::property_show_border | ( |  | ) | const

Whether the border should be shown or not.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::Notebook::property_show_border | ( |  | ) |

Whether the border should be shown or not.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<bool> Gtk::Notebook::property_show_tabs | ( |  | ) | const

Whether tabs should be shown or not.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::Notebook::property_show_tabs | ( |  | ) |

Whether tabs should be shown or not.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_WriteOnly<guint> Gtk::Notebook::property_tab_border | ( |  | ) |

Width of the border around the tab labels.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<guint> Gtk::Notebook::property_tab_hborder | ( |  | ) | const

Width of the horizontal border of tab labels.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<guint> Gtk::Notebook::property_tab_hborder | ( |  | ) |

Width of the horizontal border of tab labels.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<PositionType> Gtk::Notebook::property_tab_pos | ( |  | ) | const

Which side of the notebook holds the tabs.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<PositionType> Gtk::Notebook::property_tab_pos | ( |  | ) |

Which side of the notebook holds the tabs.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<guint> Gtk::Notebook::property_tab_vborder | ( |  | ) | const

Width of the vertical border of tab labels.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<guint> Gtk::Notebook::property_tab_vborder | ( |  | ) |

Width of the vertical border of tab labels.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::Notebook::query_tab_label_packing | ( | Widget& | child,
|  | bool & | expand,
|  | bool & | fill,
|  | PackType& | pack_type |
| ) |  |  |

void Gtk::Notebook::remove_page | ( | Widget& | child | ) |

void Gtk::Notebook::remove_page | ( | int | page_num = `0` | ) |

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

Parameters:

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

void Gtk::Notebook::reorder_child | ( | Widget& | child,
|  | int | 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:

  | child | The child to move.
  | position | The new position, or -1 to move to the end.

void Gtk::Notebook::set_current_page | ( | int | 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.

Parameters:

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

void Gtk::Notebook::set_group | ( | void * | group | ) |

Sets a group identificator pointer for notebook, notebooks sharing the same group identificator pointer will be able to exchange tabs via drag and drop.

A notebook with a `0` group identificator will not be able to exchange tabs with any other notebook.

Since gtkmm 2.12:

Parameters:

  | group | A pointer to identify the notebook group, or `0` to unset it.

void Gtk::Notebook::set_group_id | ( | int | group_id | ) |

Sets an group identificator for notebook, notebooks sharing the same group identificator will be able to exchange tabs via drag and drop.

A notebook with group identificator -1 will not be able to exchange tabs with any other notebook.

Since gtkmm 2.10:

Deprecated:2.12: use set_group() instead.

Parameters:

  | group_id | A group identificator, or -1 to unset it.

void Gtk::Notebook::set_menu_label | ( | Widget& | child,
|  | Widget& | menu_label |
| ) |  |  |

Changes the menu label for the page containing child.

Parameters:

  | child | The child widget.
  | menu_label | The menu label, or `0` for default.

void Gtk::Notebook::set_menu_label_text | ( | Widget& | child,
|  | const Glib::ustring & | menu_text |
| ) |  |  |

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

Parameters:

  | child | The child widget.
  | menu_text | The label text.

void Gtk::Notebook::set_scrollable | ( | bool | scrollable = `true` | ) |

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

Parameters:

  | scrollable | `true` if scroll arrows should be added.

void Gtk::Notebook::set_show_border | ( | bool | show_border = `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 set_show_tabs().

Parameters:

  | show_border | `true` if a bevel should be drawn around the notebook.

void Gtk::Notebook::set_show_tabs | ( | bool | show_tabs = `true` | ) |

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

Parameters:

  | show_tabs | `true` if the tabs should be shown.

void Gtk::Notebook::set_tab_detachable | ( | Widget& | child,
|  | bool | detachable = `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 set_group_id()) 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.

     static void
     on_drop_zone_drag_data_received (GtkWidget        *widget,
     GdkDragContext   *context,
     <tt>int</tt>              x,
     <tt>int</tt>              y,
     GtkSelectionData *selection_data,
     <tt>unsigned int</tt>             info,
     <tt>unsigned int</tt>             time,
     gpointer          user_data)
     {
     GtkWidget *notebook;
     GtkWidget **child;

     notebook = gtk_drag_get_source_widget (context);
     child = (void*) selection_data->data;

     process_widget (*child);
     gtk_container_remove (GTK_CONTAINER (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 gtkmm 2.10:

Parameters:

  | child | A child Gtk::Widget.
  | detachable | Whether the tab is detachable or not.

void Gtk::Notebook::set_tab_label | ( | Widget& | child,
|  | Widget& | tab_label |
| ) |  |  |

Changes the tab label for child.

If `0` is specified for tab_label, then the page will have the label 'page N'.

Parameters:

  | child | The page.
  | tab_label | The tab label widget to use, or `0` for default tab label.

void Gtk::Notebook::set_tab_label_packing | ( | Widget& | child,
|  | bool | expand,
|  | bool | fill,
|  | PackType | pack_type |
| ) |  |  |

Sets the packing parameters for the tab label of the page containing child.

See Gtk::Box::pack_start() for the exact meaning of the parameters.

Parameters:

  | child | The child widget.
  | expand | Whether to expand the bookmark or not.
  | fill | Whether the bookmark should fill the allocated area or not.
  | pack_type | The position of the bookmark.

void Gtk::Notebook::set_tab_label_text | ( | Widget& | child,
|  | const Glib::ustring & | tab_text |
| ) |  |  |

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

Parameters:

  | child | The page.
  | tab_text | The label text.

void Gtk::Notebook::set_tab_pos | ( | PositionType | pos | ) |

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

Parameters:

  | pos | The edge to draw the tabs at.

void Gtk::Notebook::set_tab_reorderable | ( | Widget& | child,
|  | bool | reorderable = `true` |
| ) |  |  |

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

Since gtkmm 2.10:

Parameters:

  | child | A child Gtk::Widget.
  | reorderable | Whether the tab is reorderable or not.

static void Gtk::Notebook::set_window_creation_hook | ( | const SlotWindowCreation& | slot | ) | `[static]`

Glib::SignalProxy2<void,Widget*,guint> Gtk::Notebook::signal_page_added | ( |  | ) |

Prototype:
  `void on_my_page_added(Widget* page, guint page_num)`

Glib::SignalProxy2<void,Widget*,guint> Gtk::Notebook::signal_page_removed | ( |  | ) |

Prototype:
  `void on_my_page_removed(Widget* page, guint page_num)`

Glib::SignalProxy2<void,Widget*,guint> Gtk::Notebook::signal_page_reordered | ( |  | ) |

Prototype:
  `void on_my_page_reordered(Widget* page, guint page_num)`

Glib::SignalProxy2< void,GtkNotebookPage*,guint > Gtk::Notebook::signal_switch_page | ( |  | ) |

Prototype:
  `void on_my_switch_page(GtkNotebookPage* page, guint page_num)`

## Friends And Related Function Documentation

Gtk::Notebook* wrap | ( | GtkNotebook * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- notebook.h