<manpage cat="cmd" id="notebook" title="notebook" version="0.2">
<!-- This file was automatically generated.  DO NOT EDIT (yet)! -->
<!-- 
     Copyright (c) 2004 Joe English
 -->
<?TROFF.TH title="notebook" section="n" date="0.2" source="tile" manual="Tile Widget Set" ?>
<namesection>
<name>ttk::notebook</name>
<desc>Multi-paned container widget</desc>
</namesection>
<synopsis>
<syntax>
<b>ttk::notebook</b> <m>pathName</m> ?<m>options...</m>?

<m>pathName</m> <b>add</b> <m>window</m> ?<m>options...</m>?
<m>pathName</m> <b>insert</b> <m>index</m> <m>window</m> ?<m>options...</m>?
</syntax>
</synopsis>
<section>
<title>DESCRIPTION</title>
<p>A <b>ttk::notebook</b> widget manages a collection of windows
and displays a single one at a time.
Each slave window is associated with a <i>tab</i>,
which the user may select to change the currently-displayed window.
</p>
</section>
<section>
<title>STANDARD OPTIONS</title>
<sl cat="stdopt" cols="4">
<li>-class</li>
<li>-cursor</li>
<li>-style</li>
<li>-takefocus</li>
</sl>
</section>
<section>
<title>WIDGET OPTIONS</title>
<optionlist>
<optiondef>
<name>-height</name>
<dbname>height</dbname>
<dbclass>Height</dbclass>
<desc>If present and greater than zero, 
specifies the desired height of the pane area
(not including internal padding or tabs).
Otherwise, the maximum height of all panes is used.
</desc>
</optiondef>
<optiondef>
<name>-padding</name>
<dbname>padding</dbname>
<dbclass>Padding</dbclass>
<desc>Specifies the amount of extra space to add around the outside
of the notebook.
The padding is a list of up to four length specifications 
<i>left top right bottom</i>.
If fewer than four elements are specified, 
<i>bottom</i> defaults to <i>top</i>,
<i>right</i> defaults to <i>left</i>, and 
<i>top</i> defaults to <i>left</i>.
</desc>
</optiondef>
<optiondef>
<name>-width</name>
<dbname>width</dbname>
<dbclass>Width</dbclass>
<desc>If present and greater than zero, 
specifies the desired width of the pane area
(not including internal padding).
Otherwise, the maximum width of all panes is used.
</desc>
</optiondef>
</optionlist>
</section>
<section id="tab-options">
<title>TAB OPTIONS</title>
<p>The following options may be specified for individual notebook panes:
</p>
<optionlist>
<optiondef>
<name>-state</name>
<dbname>state</dbname>
<dbclass>State</dbclass>
<desc>Either <b>normal</b>, <b>disabled</b> or <b>hidden</b>.  
If <b>disabled</b>, then the tab is not selectable.
If <b>hidden</b>, then the tab is not shown.
</desc>
</optiondef>
<optiondef>
<name>-sticky</name>
<dbname>sticky</dbname>
<dbclass>Sticky</dbclass>
<desc>Specifies how the slave window is positioned within the pane area.
Value is a string containing zero or more of the characters
<b>n, s, e,</b> or <b>w</b>.
Each letter refers to a side (north, south, east, or west) 
that the slave window will "stick" to,
as per the <cmd>grid</cmd> geometry manager.
</desc>
</optiondef>
<optiondef>
<name>-padding</name>
<dbname>padding</dbname>
<dbclass>Padding</dbclass>
<desc>Specifies the amount of extra space to add between the notebook and this pane.
Syntax is the same as for the widget <b>-padding</b> option.
</desc>
</optiondef>
<optiondef>
<name>-text</name>
<dbname>text</dbname>
<dbclass>Text</dbclass>
<desc>Specifies a string to be displayed in the tab.
</desc>
</optiondef>
<optiondef>
<name>-image</name>
<dbname>image</dbname>
<dbclass>Image</dbclass>
<desc>Specifies an image to display in the tab.
See <i>widget(n)</i> for details.
</desc>
</optiondef>
<optiondef>
<name>-compound</name>
<dbname>compound</dbname>
<dbclass>Compound</dbclass>
<desc>Specifies how to display the image relative to the text,
in the case both <b>-text</b> and <b>-image</b> are present.
See <i>label(n)</i> for legal values.
</desc>
</optiondef>
<optiondef>
<name>-underline</name>
<dbname>underline</dbname>
<dbclass>Underline</dbclass>
<desc>Specifies the integer index (0-based) of a character to underline 
in the text string.
The underlined character is used for mnemonic activation
if <b>ttk::notebook::enableTraversal</b> is called.
</desc>
</optiondef>
</optionlist>
</section>
<section>
<title>WIDGET COMMAND</title>
<commandlist>
<commanddef>
<command><m>pathname</m> <b>add</b> <m>window</m> ?<m>options...</m>?</command>
<desc>Adds a new tab to the notebook.
See <ref refid="tab-options">TAB OPTIONS</ref> for the list of available <i>options</i>.
If <i>window</i> is currently managed by the notebook but hidden,
it is restored to its previous position.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>configure</b> ?<m>options</m>?</command>
<desc>See <i>widget(n)</i>.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>cget</b> <m>option</m></command>
<desc>See <i>widget(n)</i>.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>forget</b> <m>tabid</m></command>
<desc>Removes the tab specified by <i>tabid</i>,
unmaps and unmanages the associated window.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>hide</b> <m>tabid</m></command>
<desc>Hides the tab specified by <i>tabid</i>.
The tab will not be displayed, but the associated window
remains managed by the notebook and its configuration remembered.
Hidden tabs may be restored with the <b>add</b> command.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>index</b> <m>tabid</m></command>
<desc>Returns the numeric index of the tab specified by <i>tabid</i>,
or the total number of tabs if <i>tabid</i> is the string "<b>end</b>".
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>insert</b> <m>pos</m> <m>subwindow</m> <m>options...</m></command>
<desc>Inserts a pane at the specified position.
<i>pos</i> is either the string <b>end</b>, an integer index, 
or the name of a managed subwindow.
If <i>subwindow</i> is already managed by the notebook, 
moves it to the specified position.
See <ref refid="tab-options">TAB OPTIONS</ref> for the list of available options.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>instate</b> <m>statespec</m> ?<m>script...</m>?</command>
<desc>See <i>widget(n)</i>.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>select</b> ?<m>tabid</m>?</command>
<desc>Selects the specified tab.  
The associated slave window will be displayed,
and the previously-selected window (if different) is unmapped.
If <i>tabid</i> is omitted, returns the widget name of the
currently selected pane.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>state</b> ?<m>statespec</m>?</command>
<desc>See <i>widget(n)</i>.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>tab</b> <m>tabid</m> ?<m>-option</m> ?<m>value ...</m></command>
<desc>Query or modify the options of the specific tab.
If no <i>-option</i> is specified,
returns a dictionary of the tab option values.
If one <i>-option</i> is specified,
returns the value of that <i>option</i>.
Otherwise, sets the <i>-option</i>s to the corresponding <i>value</i>s.
See <ref refid="tab-options">TAB OPTIONS</ref> for the available options.
</desc>
</commanddef>
<commanddef>
<command><m>pathname</m> <b>tabs</b></command>
<desc>Returns the list of windows managed by the notebook.
</desc>
</commanddef>
</commandlist>
</section>
<section>
<title>KEYBOARD TRAVERSAL</title>
<p>To enable keyboard traversal for a toplevel window
containing a notebook widget <i>$nb</i>, call:
</p>
<example>
ttk::notebook::enableTraversal $nb
</example>
<p>This will extend the bindings for the toplevel window
containing the notebook as follows:
</p>
<ul>
<li><b>Control-Tab</b> selects the tab following the currently selected one.
</li>
<li><b>Shift-Control-Tab</b> selects the tab preceding the currently selected one.
</li>
<li><b>Alt-K</b>, where <b>K</b> is the mnemonic (underlined) character
of any tab, will select that tab.
</li>
</ul>
<p>Multiple notebooks in a single toplevel may be enabled for traversal,
including nested notebooks.  
However, notebook traversal only works properly if all panes
are direct children of the notebook.
</p>
</section>
<section>
<title>TAB IDENTIFIERS</title>
<p>The <i>tabid</i> argument to the above commands may take
any of the following forms:
</p>
<ul>
<li>An integer between zero and the number of tabs;
</li>
<li>The name of a slave window;
</li>
<li>A positional specification of the form "@<i>x</i>,<i>y</i>",
which identifies the tab 
</li>
<li>The literal string "<b>current</b>",
which identifies the currently-selected tab; or:
</li>
<li>The literal string "<b>end</b>",
which returns the number of tabs 
(only valid for "<i>pathname</i> <b>index</b>").

</li>
</ul>
</section>
<section>
<title>VIRTUAL EVENTS</title>
<p>The notebook widget generates a <b>&lt;&lt;NotebookTabChanged&gt;&gt;</b>
virtual event after a new tab is selected.
</p>
</section>
<section>
<title>EXAMPLE</title>
<example>
notebook .nb
.nb add [frame .nb.f1] -text "First tab"
.nb add [frame .nb.f2] -text "Second tab"
.nb select .nb.f2
ttk::notebook::enableTraversal .nb
</example>
</section>
<seealso>
<ref>widget(n)</ref>
<ref>grid(n)</ref>
</seealso>
<keywords>
<keyword>pane</keyword>
<keyword>tab</keyword>
</keywords>
</manpage>
