Name

Notebook —

This widget can display several pages of widgets. Each page can be selected by a tab at the top of the widget. It is useful in dialogs where a lot of information has to be displayed.

Synopsis

notebookNew:: IO Notebook
notebookAppendPage:: (NotebookClass nb, WidgetClass child) => nb -> child -> String -> IO Int
notebookAppendPageMenu:: (NotebookClass nb, WidgetClass child, WidgetClass tab) => nb -> child -> tab -> String -> IO Int
notebookGetCurrentPage:: NotebookClass nb => nb -> IO Int
notebookGetMenuLabel:: (NotebookClass nb, WidgetClass w) => nb -> w -> IO (Maybe Label)
notebookGetNPages:: NotebookClass nb => nb -> IO Int
notebookGetNthPage:: NotebookClass nb => nb -> Int -> IO (Maybe Widget)
notebookGetTabLabel:: (NotebookClass nb, WidgetClass w) => nb -> w -> IO (Maybe Label)
notebookInsertPage:: (NotebookClass nb, WidgetClass child) => nb -> child -> String -> Int -> IO Int
notebookInsertPageMenu:: (NotebookClass nb, WidgetClass child, WidgetClass tab) => nb -> child -> tab -> String -> Int -> IO Int
notebookNextPage:: NotebookClass nb => nb -> IO ()
notebookPageNum:: (NotebookClass nb, WidgetClass w) => nb -> w -> IO (Maybe Int)
notebookPrependPage:: (NotebookClass nb, WidgetClass child) => nb -> child -> String -> IO Int
notebookPrependPageMenu:: (NotebookClass nb, WidgetClass child, WidgetClass tab) => nb -> child -> tab -> String -> IO Int
notebookPrevPage:: NotebookClass nb => nb -> IO ()
notebookQueryTabLabelPacking:: (NotebookClass nb, WidgetClass w) => nb -> w -> IO (Packing,PackType)
notebookRemovePage:: NotebookClass nb => nb -> Int -> IO ()
notebookReorderChild:: (NotebookClass nb, WidgetClass w) => nb -> w -> Int -> IO ()
notebookSetCurrentPage:: NotebookClass nb => nb -> Int -> IO ()
notebookSetHomogeneousTabs:: NotebookClass nb => nb -> Bool -> IO ()
notebookSetPopup:: NotebookClass nb => nb -> Bool -> IO ()
notebookSetScrollable:: NotebookClass nb => nb -> Bool -> IO ()
notebookSetShowBorder:: NotebookClass nb => nb -> Bool -> IO ()
notebookSetShowTabs:: NotebookClass nb => nb -> Bool -> IO ()
notebookSetTabBorder:: NotebookClass nb => nb -> Int -> IO ()
notebookSetTabHBorder:: NotebookClass nb => nb -> Int -> IO ()
notebookSetTabLabel:: (NotebookClass nb, WidgetClass ch, WidgetClass tab) => nb -> ch -> tab -> IO ()
notebookSetTabLabelPacking:: (NotebookClass nb, WidgetClass w) => nb -> w -> Packing -> PackType -> IO ()
notebookSetTabPos:: NotebookClass nb => nb -> PositionType -> IO ()
notebookSetTabVBorder:: NotebookClass nb => nb -> Int -> IO ()
onSwitchPage:: NotebookClass nb => nb -> (Int -> IO ()) -> IO (ConnectId nb)

Todo

check if it is sensible and possible to have something else than a Label widget in the context menu. If so, change the notebook*PageMenu function and add notebookSetMenuLabel and notebookSetMenuText.

notebookSetTabLabelText is not bound.

The signals focus-tab and select-page are not bound because it is unclear what they mean. As far as I can see they are not emitted anywhere.

Constructors

notebookNew

Create a new notebook.

notebookNew

Methods

notebookAppendPage

Insert a new tab to the right of the existing tabs.

notebookAppendPage:: nb:: child:: String:: IO Int
nbchildtabLabel

The tabName will be inserted as a Label widget. In case the context menu is enabled, this name will appear in the menu. If you want to specify something else to go in the tab, use notebookAppendPageMenu and specify some suitable widget for menuLabel. Returns index (starting from 0) of the appended page in the notebook, or -1 if function fails.

<warning><para>This function returned () in Gtk version 2.2.X and earlier</warning><para>

notebookAppendPageMenu

Insert a new tab to the right of the existing tabs. menuLabel is the label for the context menu (useful if tabLabel is not a Label widget). Return index (starting from 0) of the appended page in the notebook, or -1 if function fails

notebookAppendPageMenu:: nb:: child:: tab:: String:: IO Int
nbchildtabWidgetmenuLabel

<warning><para>This function returned () in Gtk version 2.2.X and earlier</warning><para>

notebookGetCurrentPage

Query the currently selected page.

notebookGetCurrentPage:: nb:: IO Int
nb

Returns -1 if notebook has no pages.

notebookGetMenuLabel

Extract the menu label from the given child.

notebookGetMenuLabel:: nb:: w:: IO (Maybe Label)
nbchild

Returns Nothing if child was not found.

notebookGetNPages

Get the number of pages in a notebook.

notebookGetNPages:: nb:: IO Int
nb

Only available in Gtk 2.2 and higher.

notebookGetNthPage

Retrieve the child widget at positon pos (stating from 0).

notebookGetNthPage:: nb:: Int:: IO (Maybe Widget)
nbpos

Returns Nothing if the index is out of bounds.

notebookGetTabLabel

Extract the tab label from the given child.

notebookGetTabLabel:: nb:: w:: IO (Maybe Label)
nbchild

notebookInsertPage

Insert a new tab at the specified position.

notebookInsertPage:: nb:: child:: String:: Int:: IO Int
nbchildtabLabelpos

The tabName will be inserted as a Label widget. In case the context menu is enabled, this name will appear in the menu. If you want to specify something else to go in the tab, use notebookInsertPageMenu and specify some suitable widget for menuLabel. Return index (starting from 0) of the inserted page in the notebook, or -1 if function fails

<warning><para>This function returned () in Gtk version 2.2.X and earlier</warning><para>

notebookInsertPageMenu

Insert a new tab between the tab no. pos and pos+1. menuLabel is the label for the context menu (useful if tabLabel is not a Label widget). Return index (starting from 0) of the inserted page in the notebook, or -1 if function fails

notebookInsertPageMenu:: nb:: child:: tab:: String:: Int:: IO Int
nbchildtabWidgetmenuLabelpos

<warning><para>This function returned () in Gtk version 2.2.X and earlier</warning><para>

notebookNextPage

Move to the right neighbour of the current page.

notebookNextPage:: nb:: IO ()
nb

Nothing happens if there is no such page.

notebookPageNum

Query the page the child widget is contained in.

notebookPageNum:: nb:: w:: IO (Maybe Int)
nbchild

The function returns the page number if the child was found, Nothing otherwise.

notebookPrependPage

Insert a new tab to the left of the existing tabs.

notebookPrependPage:: nb:: child:: String:: IO Int
nbchildtabLabel

The tabName will be inserted as a Label widget. In case the context menu is enabled, this name will appear in the menu. If you want to specify something else to go in the tab, use notebookPrependPageMenu and specify some suitable widget for menuLabel. Return index (starting from 0) of the prepended page in the notebook, or -1 if function fails

<warning><para>This function returned () in Gtk version 2.2.X and earlier</warning><para>

notebookPrependPageMenu

Insert a new tab to the left of the existing tabs. menuLabel is the label for the context menu (useful if tabLabel is not a Label widget). Return index (starting from 0) of the prepended page in the notebook, or -1 if function fails

notebookPrependPageMenu:: nb:: child:: tab:: String:: IO Int
nbchildtabWidgetmenuLabel

<warning><para>This function returned () in Gtk version 2.2.X and earlier</warning><para>

notebookPrevPage

Move to the left neighbour of the current page.

notebookPrevPage:: nb:: IO ()
nb

Nothing happens if there is no such page.

notebookQueryTabLabelPacking

Query the packing attributes of the given child.

notebookQueryTabLabelPacking:: nb:: w:: IO (Packing,PackType)
nbchild

notebookRemovePage

Remove a specific page from the notebook, counting from 0.

notebookRemovePage:: nb:: Int:: IO ()
nbpos

notebookReorderChild

Move a page withing the notebook.

notebookReorderChild:: nb:: w:: Int:: IO ()
nbchildpos

notebookSetCurrentPage

Move to the specified page of the notebook.

notebookSetCurrentPage:: nb:: Int:: IO ()
nbpos

If pos is out of range (e.g. negative) select the last page.

notebookSetHomogeneousTabs

Sets whether the tabs must have all the same size or not.

notebookSetHomogeneousTabs:: nb:: Bool:: IO ()
nbhom

notebookSetPopup

Enable or disable context menus with all tabs in it.

notebookSetPopup:: nb:: Bool:: IO ()
nbenable

notebookSetScrollable

Set whether scroll bars will be added in case the notebook has too many tabs to fit the widget size.

notebookSetScrollable:: nb:: Bool:: IO ()
nbscrollable

notebookSetShowBorder

In case the tabs are not shown, specify whether to draw a border around the notebook.

notebookSetShowBorder:: nb:: Bool:: IO ()
nbshowBorder

notebookSetShowTabs

Show or hide the tabs of a notebook.

notebookSetShowTabs:: nb:: Bool:: IO ()
nbshowTabs

notebookSetTabBorder

Set the width of the borders of the tab labels.

notebookSetTabBorder:: nb:: Int:: IO ()
nbwidth

Sets both vertical and horizontal widths.

notebookSetTabHBorder

Set the width of the borders of the tab labels.

notebookSetTabHBorder:: nb:: Int:: IO ()
nbwidth

Sets horizontal widths.

notebookSetTabLabel

Set a new tab label for a given child.

notebookSetTabLabel:: nb:: ch:: tab:: IO ()
nbchildtab

notebookSetTabLabelPacking

Set the packing attributes of the given child.

notebookSetTabLabelPacking:: nb:: w:: Packing:: PackType:: IO ()
nbchildpackpt

notebookSetTabPos

Specify at which border the tabs should be drawn.

notebookSetTabPos:: nb:: PositionType:: IO ()
nbpt

notebookSetTabVBorder

Set the width of the borders of the tab labels.

notebookSetTabVBorder:: nb:: Int:: IO ()
nbwidth

Sets vertical widths.

Signals

onSwitchPage

This signal is emitted when a new page is selected.

onSwitchPage:: nb:: (Int -> IO ()):: IO (ConnectId nb)
nbfun