Package: gtk

Class gtk-notebook

Superclasses

gtk-container, gtk-widget, g-initially-unowned, gtk-buildable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

None

Direct Slots

enable-popup
The "enable-popup" property of type :boolean (Read / Write)
If true, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page.
Default value: nil
group-name
The "group-name" property of type :string (Read / Write)
Group name for tab drag and drop.
Default value: nil
Since 2.24
page
The "page" property of type :int (Read / Write)
The index of the current page.
Allowed values: >= G_MAXULONG
Default value: -1
scrollable
The "scrollable" property of type :boolean (Read / Write)
If true, scroll arrows are added if there are too many tabs to fit.
Default value: nil
show-border
The "show-border" property of type :boolean (Read / Write)
Whether the border should be shown.
Default value: true
show-tabs
The "show-tabs" property of type :boolean (Read / Write)
Whether tabs should be shown.
Default value: true
tab-pos
The "tab-pos" property of type gtk-position-type (Read / Write)
Which side of the notebook holds the tabs.
Default value: :top

Details

The gtk-notebook container 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 gtk-notebook. Among other things, you can choose on which edge the tabs appear, see the function gtk-notebook-tab-pos, whether, if there are too many tabs to fit the notebook should be made bigger or scrolling arrows added, see the function gtk-notebook-scrollable, and whether there will be a popup menu allowing the users to switch pages, see the functions gtk-notebook-popup-enable and gtk-notebook-popup-disable.

GtkNotebook as GtkBuildable
The gtk-notebook 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.

Example: A UI definition fragment with gtk-notebook
 <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>    

Child Property Details

The "detachable" child property
"detachable" of type :boolean (Read / Write)
Whether the tab is detachable.
Default value: nil

The "menu-label" child property
"menu-label" of type :string (Read / Write)
The string displayed in the child's menu entry.
Default value: nil

The "position" child property
"position" of type :int (Read / Write)
The index of the child in the parent.
Allowed values: >= G_MAXULONG
Default value: 0

The "reorderable" child property
"reorderable" of type :boolean (Read / Write)
Whether the tab is reorderable by user action.
Default value: nil

The "tab-expand" child property
"tab-expand" of type :boolean (Read / Write)
Whether to expand the child's tab.
Default value: nil

The "tab-fill" child property
"tab-fill" of type :boolean (Read / Write)
Whether the child's tab should fill the allocated area.
Default value: true

The "tab-label" child property
"tab-label" of type :string (Read / Write)
The string displayed on the child's tab label.
Default value: nil

Style Property Details

The "arrow-spacing" style property
"arrow-spacing" of type :int (Read)
The "arrow-spacing" property defines the spacing between the scroll arrows and the tabs.
Allowed values: >= 0
Default value: 0
Since 2.10

The "has-backward-stepper" style property
"has-backward-stepper" of type :boolean (Read)
The "has-backward-stepper" property determines whether the standard backward arrow button is displayed.
Default value: true
Since 2.4

The "has-forward-stepper" style property
"has-forward-stepper" of type :boolean (Read)
The "has-forward-stepper" property determines whether the standard forward arrow button is displayed.
Default value: true
Since 2.4

The "has-secondary-backward-stepper" style property
"has-secondary-backward-stepper" of type :boolean (Read)
The "has-secondary-backward-stepper" property determines whether a second backward arrow button is displayed on the opposite end of the tab area.
Default value: nil
Since 2.4

The "has-secondary-forward-stepper" style property
"has-secondary-forward-stepper" of type :boolean (Read)
The "has-secondary-forward-stepper" property determines whether a second forward arrow button is displayed on the opposite end of the tab area.
Default value: nil
Since 2.4

The "initial-gap" style property
"initial-gap" of type :int (Read)
The "initial-gap" property defines the minimum size for the initial gap between the first tab.
Allowed values: >= 0
Default value: 0
Since 3.2

The "tab-curvature" style property
"tab-curvature" of type :int (Read)
The "tab-curvature" property defines size of tab curvature.
Allowed values: >= 0
Default value: 1
Since 2.10

The "tab-overlap" style property
"tab-overlap" of type :int (Read)
The "tab-overlap" property defines size of tab overlap area.
Default value: 2
Since 2.10

Signal Details

The "change-current-page" signal
 lambda (notebook arg1)   : Action      
The "create-window" signal
 lambda (notebook page x y)   : Run Last      
The "create-window" signal is emitted when a detachable tab is dropped on the root window. A handler for this signal can create a window containing a notebook where the tab will be attached. It is also responsible for moving/resizing the window and adding the necessary properties to the notebook, e. g. the "group".
notebook
The gtk-notebook emitting the signal.
page
The tab of notebook that is being detached.
x
The x coordinate where the drop happens.
y
The y coordinate where the drop happens.
Returns
A gtk-notebook that page should be added to, or nil.
Since 2.12

The "focus-tab" signal
 lambda (notebook arg1)   : Action      
The "move-focus-out" signal
 lambda (notebook arg1)   : Action      
The "page-added" signal
 lambda (notebook child page-num)   : Run Last      
The "page-added" signal is emitted in the notebook right after a page is added to the notebook.
notebook
The gtk-notebook.
child
The child gtk-widget affected.
page-num
The new page number for child.
Since 2.10

The "page-removed" signal
 lambda (notebook child page-num)   : Run Last      
The "page-removed" signal is emitted in the notebook right after a page is removed from the notebook.
notebook
The gtk-notebook.
child
The child gtk-widget affected.
page-num
The child page number.
Since 2.10

The "page-reordered" signal
 lambda (notebook child page-num)   : Run Last      
The "page-reordered" signal is emitted in the notebook right after a page has been reordered.
notebook
The gtk-notebook.
child
The child gtk-widget affected.
page-num
The new page number for child.
Since 2.10

The "reorder-tab" signal
 lambda (notebook arg1 arg2)   : Action      
The "select-page" signal
 lambda (notebook arg1)   : Action      
The "switch-page" signal
 lambda (notebook page page-num)   : Run Last      
Emitted when the user or a function changes the current page.
notebook
The object which received the signal.
page
The new current page.
page-num
The index of the page.
 

Slot Access Functions

Inherited Slot Access Functions

2014-8-20