Gtk.Notebook
const Gtk = imports.gi.Gtk; let notebook = new Gtk.Notebook({ enable_popup: value, group_name: value, page: value, scrollable: value, show_border: value, show_tabs: value, tab_pos: value, });
The Gtk.Notebook widget is a 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.set_tab_pos), whether, if there are too many tabs to fit the notebook should be made bigger or scrolling arrows added (see Gtk.set_scrollable), and whether there will be a popup menu allowing the users to switch pages. (see Gtk.popup_enable, Gtk.popup_disable)
<refsect2 id="GtkNotebook-BUILDER-UI"> <title>GtkNotebook as GtkBuildable</title> <para> The GtkNotebook implementation of the 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. </para> <example> <title>A UI definition fragment with GtkNotebook</title> <programlisting><![CDATA[ <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> ]]></programlisting> </example> </refsect2>
Hierarchy
-
GObject.Object
-
GObject.InitiallyUnowned
-
Gtk.Widget
-
Gtk.Container
- Gtk.Notebook
-
-
-
Methods
- Gtk.Notebook.prototype.append_page
- Gtk.Notebook.prototype.append_page_menu
- Gtk.Notebook.prototype.get_action_widget
- Gtk.Notebook.prototype.get_current_page
- Gtk.Notebook.prototype.get_group_name
- Gtk.Notebook.prototype.get_menu_label
- Gtk.Notebook.prototype.get_menu_label_text
- Gtk.Notebook.prototype.get_n_pages
- Gtk.Notebook.prototype.get_nth_page
- Gtk.Notebook.prototype.get_scrollable
- Gtk.Notebook.prototype.get_show_border
- Gtk.Notebook.prototype.get_show_tabs
- Gtk.Notebook.prototype.get_tab_detachable
- Gtk.Notebook.prototype.get_tab_hborder
- Gtk.Notebook.prototype.get_tab_label
- Gtk.Notebook.prototype.get_tab_label_text
- Gtk.Notebook.prototype.get_tab_pos
- Gtk.Notebook.prototype.get_tab_reorderable
- Gtk.Notebook.prototype.get_tab_vborder
- Gtk.Notebook.prototype.insert_page
- Gtk.Notebook.prototype.insert_page_menu
- Gtk.Notebook.prototype.next_page
- Gtk.Notebook.prototype.page_num
- Gtk.Notebook.prototype.popup_disable
- Gtk.Notebook.prototype.popup_enable
- Gtk.Notebook.prototype.prepend_page
- Gtk.Notebook.prototype.prepend_page_menu
- Gtk.Notebook.prototype.prev_page
- Gtk.Notebook.prototype.remove_page
- Gtk.Notebook.prototype.reorder_child
- Gtk.Notebook.prototype.set_action_widget
- Gtk.Notebook.prototype.set_current_page
- Gtk.Notebook.prototype.set_group_name
- Gtk.Notebook.prototype.set_menu_label
- Gtk.Notebook.prototype.set_menu_label_text
- Gtk.Notebook.prototype.set_scrollable
- Gtk.Notebook.prototype.set_show_border
- Gtk.Notebook.prototype.set_show_tabs
- Gtk.Notebook.prototype.set_tab_detachable
- Gtk.Notebook.prototype.set_tab_label
- Gtk.Notebook.prototype.set_tab_label_text
- Gtk.Notebook.prototype.set_tab_pos
- Gtk.Notebook.prototype.set_tab_reorderable