Gtk2::Notebook(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– Gtk2::Notebook πŸ’–

okay bestie, welcome to the manual page for Gtk2::Notebook(3) β€” that's the Perl wrapper for GtkNotebook, from the User Contributed Perl Documentation. it's giving tabbed-interface royalty, and honestly? iconic. let's get into it πŸŽ€


🌸 NAME 🌸

Gtk2::Notebook β€” it's a wrapper for GtkNotebook. that's it, that's the name section, slay πŸ’…


πŸ¦‹ HIERARCHY πŸ¦‹

so this is the family tree, and you gotta respect the lineage:

  Glib::Object
  +----Glib::InitiallyUnowned
       +----Gtk2::Object
            +----Gtk2::Widget
                 +----Gtk2::Container
                      +----Gtk2::Notebook

it's descended from Glib::Object all the way down through Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, and Gtk2::Container before it becomes its own main character as Gtk2::Notebook. periodt. πŸ‘‘


✨ INTERFACES ✨

these are the interfaces it's rockin':

  • Glib::Object::_Unregistered::AtkImplementorIface
  • Gtk2::Buildable

πŸ’… METHODS πŸ’…

okay here's the good stuff, the actual things you can do. buckle up.

  • widget = Gtk2::Notebook->new β€” makes you a shiny brand-new notebook, no cap.
  • widget or undef = $notebook->get_action_widget ($pack_type) β€” grabs the action widget for a given pack type.
    • $pack_type (Gtk2::PackType)
    • Since: gtk+ 2.20
  • $notebook->set_action_widget ($widget, $pack_type) β€” sets the action widget.
    • $widget (Gtk2::Widget)
    • $pack_type (Gtk2::PackType)
    • Since: gtk+ 2.20
  • integer = $notebook->append_page ($child, $tab_label=undef) β€” appends a page to the end, obviously.
    • $child (Gtk2::Widget)
    • $tab_label (scalar)
    • (integer return since Gtk2-Perl 1.080)
  • integer = $notebook->append_page_menu ($child, $tab_label, $menu_label) β€” append a page with a menu label too.
    • $child (Gtk2::Widget)
    • $tab_label (Gtk2::Widget or undef)
    • $menu_label (Gtk2::Widget or undef)
    • (integer return since Gtk2-Perl 1.080)
  • integer = $notebook->get_current_page β€” which page are we on rn? this tells you.
  • $notebook->set_current_page ($page_num) β€” sets the current page.
    • $page_num (integer)
  • integer = $notebook->get_group_id β€” gets the group id.
    • Since: gtk+ 2.10
  • $notebook->set_group_id ($group_id) β€” sets the group id.
    • $group_id (integer)
    • Since: gtk+ 2.10
  • integer = $notebook->insert_page ($child, $tab_label, $position) β€” inserts a page at a specific spot, very precise of you.
    • $child (Gtk2::Widget)
    • $tab_label (scalar)
    • $position (integer)
    • (integer return since Gtk2-Perl 1.080)
  • integer = $notebook->insert_page_menu ($child, $tab_label, $menu_label, $position) β€” inserts a page with a menu label, at a position.
    • $child (Gtk2::Widget)
    • $tab_label (Gtk2::Widget or undef)
    • $menu_label (Gtk2::Widget or undef)
    • $position (integer)
    • (integer return since Gtk2-Perl 1.080)
  • widget or undef = $notebook->get_menu_label ($child) β€” gets the menu label widget for a child.
    • $child (Gtk2::Widget)
  • $notebook->set_menu_label ($child, $menu_label=undef) β€” sets the menu label for a child.
    • $child (Gtk2::Widget)
    • $menu_label (Gtk2::Widget or undef)
  • string = $notebook->get_menu_label_text ($child) β€” gets the menu label text.
    • $child (Gtk2::Widget)
  • $notebook->set_menu_label_text ($child, $menu_text) β€” sets the menu label text.
    • $child (Gtk2::Widget)
    • $menu_text (string)
  • integer = $notebook->get_n_pages β€” how many pages we got? this.
  • $notebook->next_page β€” go to the next page, onward bestie ➑️
  • widget or undef = $notebook->get_nth_page ($page_num) β€” grabs the widget at that page index.
    • $page_num (integer)
  • integer = $notebook->page_num ($child) β€” what page index is this child on?
    • $child (Gtk2::Widget)
  • $notebook->popup_disable β€” disables the popup.
  • $notebook->popup_enable β€” enables the popup.
  • integer = $notebook->prepend_page ($child, $tab_label=undef) β€” puts a page at the very front, main character behavior honestly.
    • $child (Gtk2::Widget)
    • $tab_label (scalar)
    • (integer return since Gtk2-Perl 1.080)
  • integer = $notebook->prepend_page_menu ($child, $tab_label, $menu_label) β€” prepend a page with a menu label.
    • $child (Gtk2::Widget)
    • $tab_label (Gtk2::Widget or undef)
    • $menu_label (Gtk2::Widget or undef)
    • (integer return since Gtk2-Perl 1.080)
  • $notebook->prev_page β€” go back a page ⬅️
  • list = $notebook->query_tab_label_packing ($child) β€” returns a list about the tab label packing.
    • $child (Gtk2::Widget)
  • $notebook->remove_page ($page_num) β€” removes a page by index. bye bestie πŸ‘‹
    • $page_num (integer)
  • $notebook->reorder_child ($child, $position) β€” moves a child to a new position.
    • $child (Gtk2::Widget)
    • $position (integer)
  • boolean = $notebook->get_scrollable β€” is it scrollable? asks.
  • $notebook->set_scrollable ($scrollable) β€” sets the scrollable-ness.
    • $scrollable (boolean)
  • boolean = $notebook->get_show_border β€” is the border showing?
  • $notebook->set_show_border ($show_border) β€” toggles the border.
    • $show_border (boolean)
  • boolean = $notebook->get_show_tabs β€” are the tabs showing?
  • $notebook->set_show_tabs ($show_tabs) β€” toggles the tabs.
    • $show_tabs (boolean)
  • $notebook->set_tab_border ($border_width) β€” sets the tab border width.
    • $border_width (integer)
  • boolean = $notebook->get_tab_detachable ($child) β€” can this tab be detached?
    • $child (Gtk2::Widget)
    • Since: gtk+ 2.10
  • $notebook->set_tab_detachable ($child, $detachable) β€” sets whether that tab is detachable.
    • $child (Gtk2::Widget)
    • $detachable (boolean)
    • Since: gtk+ 2.10
  • unsigned = $notebook->get_tab_hborder β€” gets the tab horizontal border.
    • Since: gtk+ 2.22
  • $notebook->set_tab_hborder ($tab_hborder) β€” sets the tab horizontal border.
    • $tab_hborder (integer)
  • widget = $notebook->get_tab_label ($child) β€” gets the tab label widget for a child.
    • $child (Gtk2::Widget)
  • $notebook->set_tab_label_packing ($child, $expand, $fill, $pack_type) β€” sets the packing for a child's tab label.
    • $child (Gtk2::Widget)
    • $expand (boolean)
    • $fill (boolean)
    • $pack_type (Gtk2::PackType)
  • $notebook->set_tab_label ($child, $tab_label=undef) β€” sets the tab label for a child.
    • $child (Gtk2::Widget)
    • $tab_label (Gtk2::Widget or undef)
  • string = $notebook->get_tab_label_text ($child) β€” gets the tab label text.
    • $child (Gtk2::Widget)
  • $notebook->set_tab_label_text ($child, $tab_text) β€” sets the tab label text.
    • $child (Gtk2::Widget)
    • $tab_text (string)
  • positiontype = $notebook->get_tab_pos β€” where are the tabs even at?
  • $notebook->set_tab_pos ($pos) β€” sets the tab position.
    • $pos (Gtk2::PositionType)
  • boolean = $notebook->get_tab_reorderable ($child) β€” can the user reorder this tab?
    • $child (Gtk2::Widget)
    • Since: gtk+ 2.10
  • $notebook->set_tab_reorderable ($child, $reorderable) β€” sets whether it's reorderable.
    • $child (Gtk2::Widget)
    • $reorderable (boolean)
    • Since: gtk+ 2.10
  • unsigned = $notebook->get_tab_vborder β€” gets the tab vertical border.
    • Since: gtk+ 2.22
  • $notebook->set_tab_vborder ($tab_vborder) β€” sets the tab vertical border.
    • $tab_vborder (integer)
  • Gtk2::Notebook->set_window_creation_hook ($func, $data=undef) β€” sets the window creation hook.
    • $func (scalar)
    • $data (scalar)
    • Since: gtk+ 2.10

πŸŽ€ PROPERTIES πŸŽ€

these are the notebook's own little settings, and yes, each one lists its type, default, and flags, so read carefully bestie:

  • 'enable-popup' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” if TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page πŸ–±οΈ
  • 'group' (gpointer : default 0 : readable / writable / private / static-nick / static-blurb / deprecated) β€” group for tabs drag and drop. heads up, this one's deprecated!
  • 'group-id' (integer : default -1 : readable / writable / private / static-nick / static-blurb / deprecated) β€” group ID for tabs drag and drop. also deprecated, no cap.
  • 'group-name' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” group name for tabs drag and drop.
  • 'homogeneous' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” whether tabs should have homogeneous sizes.
  • 'page' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” the index of the current page.
  • 'scrollable' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” if TRUE, scroll arrows are added if there are too many tabs to fit.
  • 'show-border' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” whether the border should be shown or not.
  • 'show-tabs' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” whether tabs should be shown or not.
  • 'tab-border' (Glib::UInt : default 2 : writable / private / static-nick / static-blurb) β€” width of the border around the tab labels. (note: writable only, not readable, iykyk)
  • 'tab-hborder' (Glib::UInt : default 2 : readable / writable / private / static-nick / static-blurb) β€” width of the horizontal border of tab labels.
  • 'tab-pos' (Gtk2::PositionType : default "top" : readable / writable / private / static-nick / static-blurb) β€” which side of the notebook holds the tabs.
  • 'tab-vborder' (Glib::UInt : default 2 : readable / writable / private / static-nick / static-blurb) β€” width of the vertical border of tab labels.

🧚 CHILD PROPERTIES 🧚

these are the properties that belong to the children of the notebook, one per page, and they're giving customization energy:

  • 'detachable' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” whether the tab is detachable.
  • 'menu-label' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” the string displayed in the child's menu entry.
  • 'position' (integer : default 0 : readable / writable / private / static-nick / static-blurb) β€” the index of the child in the parent.
  • 'reorderable' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” whether the tab is reorderable by user action or not.
  • 'tab-expand' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” whether to expand the child's tab or not.
  • 'tab-fill' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” whether the child's tab should fill the allocated area or not.
  • 'tab-label' (string : default undef : readable / writable / private / static-nick / static-blurb) β€” the string displayed on the child's tab label.
  • 'tab-pack' (Gtk2::PackType : default "start" : readable / writable / private / static-nick / static-blurb) β€” a GtkPackType indicating whether the child is packed with reference to the start or end of the parent.

πŸ’œ STYLE PROPERTIES πŸ’œ

the aesthetic settings, the glow-up section, if you will:

  • 'arrow-spacing' (integer : default 0 : readable / private / static-nick / static-blurb) β€” scroll arrow spacing.
  • 'has-backward-stepper' (boolean : default true : readable / private / static-nick / static-blurb) β€” display the standard backward arrow button.
  • 'has-forward-stepper' (boolean : default true : readable / private / static-nick / static-blurb) β€” display the standard forward arrow button.
  • 'has-secondary-backward-stepper' (boolean : default false : readable / private / static-nick / static-blurb) β€” display a second backward arrow button on the opposite end of the tab area.
  • 'has-secondary-forward-stepper' (boolean : default false : readable / private / static-nick / static-blurb) β€” display a second forward arrow button on the opposite end of the tab area.
  • 'tab-curvature' (integer : default 1 : readable / private / static-nick / static-blurb) β€” size of tab curvature.
  • 'tab-overlap' (integer : default 2 : readable / private / static-nick / static-blurb) β€” size of tab overlap area.

πŸ”₯ SIGNALS πŸ”₯

the notebook yells these out when stuff happens. connect to them, bestie, and vibe check accordingly:

  • boolean = change-current-page (Gtk2::Notebook, integer)
  • Gtk2::Notebook = create-window (Gtk2::Notebook, Gtk2::Widget, integer, integer)
  • boolean = focus-tab (Gtk2::Notebook, Gtk2::NotebookTab)
  • move-focus-out (Gtk2::Notebook, Gtk2::DirectionType)
  • page-added (Gtk2::Notebook, Gtk2::Widget, Glib::UInt)
  • page-removed (Gtk2::Notebook, Gtk2::Widget, Glib::UInt)
  • page-reordered (Gtk2::Notebook, Gtk2::Widget, Glib::UInt)
  • boolean = reorder-tab (Gtk2::Notebook, Gtk2::DirectionType, boolean)
  • boolean = select-page (Gtk2::Notebook, boolean)
  • switch-page (Gtk2::Notebook, gpointer, Glib::UInt)

🌈 ENUMS AND FLAGS 🌈

the little named constants, all listed out because we do NOT skip details in this house:

enum Gtk2::DirectionType

  • 'tab-forward' / GTK_DIR_TAB_FORWARD
  • 'tab-backward' / GTK_DIR_TAB_BACKWARD
  • 'up' / GTK_DIR_UP
  • 'down' / GTK_DIR_DOWN
  • 'left' / GTK_DIR_LEFT
  • 'right' / GTK_DIR_RIGHT

enum Gtk2::NotebookTab

  • 'first' / GTK_NOTEBOOK_TAB_FIRST
  • 'last' / GTK_NOTEBOOK_TAB_LAST

enum Gtk2::PackType

  • 'start' / GTK_PACK_START
  • 'end' / GTK_PACK_END

enum Gtk2::PositionType

  • 'left' / GTK_POS_LEFT
  • 'right' / GTK_POS_RIGHT
  • 'top' / GTK_POS_TOP
  • 'bottom' / GTK_POS_BOTTOM

and that's part 1, bestie β€” more of this page is coming, so don't go anywhere πŸ’–

✨ SEE ALSO ✨

okay bestie, when you're done living your Gtk2::Notebook main character era, here's the lil friend group you're gonna wanna visit next 🫢

  • Gtk2 β€” the whole vibe, the mothership, the it-girl of the family πŸ’…
  • Glib::Object β€” the ancestor at the very top of the tree, no cap
  • Glib::InitiallyUnowned β€” also up there in the lineage, iconic behaviour
  • Gtk2::Object β€” one rung down, still giving legacy
  • Gtk2::Widget β€” everything you can see and touch basically descends from this
  • Gtk2::Container β€” the direct parent energy, the one that taught notebook how to hold things

the receipts, periodt ✨

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice. πŸŽ€

fr fr, go read the Gtk2 page if you want the whole legal saga β€” it's all there, and it ate πŸ’…


and that's a wrap on Gtk2::Notebook, bestie!! 🌈 this lil legend was written up in perl v5.42.0, dated 2025-07-25, and it lives at Gtk2::Notebook(3) β€” go forth and build the cutest tabbed interfaces the world has ever seen πŸ‘‘πŸ’œβœ¨

πŸ“¦ where this page comes from